add for/of to js (change description)

This commit is contained in:
hra 2018-07-01 15:10:13 -07:00
parent faca0e7944
commit 2a3d19ef73

View File

@ -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){