mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-03-16 04:10:01 +01:00
[js/fr] fix for...of loop
Co-authored-by: Carl20cent <carl.vincent38@gmail.com> bump changed section variable declarations to ES6 Update fr-fr/javascript-fr.html.markdown
This commit is contained in:
parent
3aba6767ed
commit
f92694aac9
@ -1,12 +1,12 @@
|
||||
---
|
||||
language: javascript
|
||||
contributors:
|
||||
- ['Leigh Brenecki', 'https://leigh.net.au']
|
||||
- ['Ariel Krakowski', 'http://www.learneroo.com']
|
||||
- ["Leigh Brenecki", "https://leigh.net.au"]
|
||||
- ["Ariel Krakowski", "http://www.learneroo.com"]
|
||||
filename: javascript-fr.js
|
||||
translators:
|
||||
- ['@nbrugneaux', 'https://nicolasbrugneaux.me']
|
||||
- ['Michel Antoine', 'https://github.com/antoin-m']
|
||||
- ["@nbrugneaux", "https://nicolasbrugneaux.me"]
|
||||
- ["Michel Antoine", "https://github.com/antoin-m"]
|
||||
lang: fr-fr
|
||||
---
|
||||
|
||||
@ -328,13 +328,15 @@ for (var x in person){
|
||||
}
|
||||
description; // = "Paul Ken 18 "
|
||||
|
||||
// *ES6:* La boucle for...of permet d'itérer sur les propriétés d'un objet
|
||||
var description = "";
|
||||
var person = {fname:"Paul", lname:"Ken", age:18};
|
||||
for (var x of person){
|
||||
description += x + " ";
|
||||
// *ES6:* La boucle for...of permet de parcourir un objet itérable
|
||||
// (ce qui inclut les objets Array, Map, Set, String, ... Mais pas un objet littéral !)
|
||||
let myPets = "";
|
||||
const pets = ["cat", "dog", "hamster", "hedgehog"];
|
||||
for (let pet of pets){ //`(const pet of pets)` is also possible
|
||||
|
||||
myPets += pet + " ";
|
||||
}
|
||||
description; // = "Paul Ken 18 "
|
||||
myPets; // = 'cat dog hamster hedgehog '
|
||||
|
||||
// && est le "et" logique, || est le "ou" logique
|
||||
if (house.size === 'big' && house.colour === 'blue'){
|
||||
|
Loading…
x
Reference in New Issue
Block a user