-
for...ofstatement iterates over data that the iterable object defines to be iterated over.- Includes built-in String, Array, Array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined iterables
String,Array,TypedArray,MapandSetare iterables (Iterable objects), because each of their prototype objects implements an @@iterator method.- Object (or one of the objects up its prototype chain) has a property with a @@iterator key which is available via constant Symbol.iterator
- Works in terms of
.iterator()and.next()anduse @iterator property
-
for...instatement iterates over the enumerable properties of an object, in an arbitrary order.- Built for iterating object properties.
- Should not be used to iterate over an Array where the index order is important.
-
for await...ofstatement creates a loop iterating over async iterable objects as well as on sync iterables- Includs: built-in String, Array, Array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined async/sync iterables
-
let / const- let & const are
hoistedbutnot initialised.- The lexically declared variables however stay uninitialised.
- var is
hoistedandinitialised with undefined.
ReferenceError exceptionis thrown when you try to access it.Temporal Dead Zoneis everything (trying to access variable) beforelet/const/classstatement is evaluated/initialised.
- let & const are
-
Arrow function
-
Spread syntax (splat operator)
-
Promise
-
async/await(ES2017) -
Template Literals
ES6
Directory actions
More options
Directory actions
More options
ES6
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||