diff options
author | Ev Bogdanov <evbogdanov.com@gmail.com> | 2018-09-08 21:09:42 +0300 |
---|---|---|
committer | Ev Bogdanov <evbogdanov.com@gmail.com> | 2018-09-08 21:09:42 +0300 |
commit | 0799909efb0392cf1a2d42e5cad3439449fa9ddc (patch) | |
tree | 963a666e664cd3f74adbca6bef593ce66d4c2f5b /javascript.html.markdown | |
parent | b622673dae3441f1260401fbb44d90e0e4aea6a2 (diff) | |
parent | 49a2bf306fcf365192934d006a244a9033909850 (diff) |
Merge remote-tracking branch 'upstream/master' into jquery-ru
Diffstat (limited to 'javascript.html.markdown')
-rw-r--r-- | javascript.html.markdown | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown index 52084e93..ecaf02c5 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -266,6 +266,15 @@ for (var x in person){ description += person[x] + " "; } // description = 'Paul Ken 18 ' +// 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){ + myPets += pet + " "; +} // myPets = 'cat dog hamster hedgehog ' + // && is logical and, || is logical or if (house.size == "big" && house.colour == "blue"){ house.contains = "bear"; |