mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00: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 = '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 pets = ["cat", "dog", "hamster", "hedgehog"];
|
||||
for (var pet of pets){
|
||||
|
Loading…
Reference in New Issue
Block a user