mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-26 08:44:47 +03:00
add for/of to js (change description)
This commit is contained in:
parent
faca0e7944
commit
2a3d19ef73
@ -248,7 +248,9 @@ for (var x in person){
|
|||||||
description += person[x] + " ";
|
description += person[x] + " ";
|
||||||
} // description = 'Paul Ken 18 '
|
} // description = 'Paul Ken 18 '
|
||||||
|
|
||||||
// The for/of statement allows iteration over an iterator.
|
// The for/of statement allows iteration over iterable objects (including the built-in String,
|
||||||
|
// Array, e.g. the Array-like arguments or NodeList objects, TypedArray, Map and Set,
|
||||||
|
// and user-defined iterables).
|
||||||
var myPets = "";
|
var myPets = "";
|
||||||
var pets = ["cat", "dog", "hamster", "hedgehog"];
|
var pets = ["cat", "dog", "hamster", "hedgehog"];
|
||||||
for (var pet of pets){
|
for (var pet of pets){
|
||||||
|
Loading…
Reference in New Issue
Block a user