๐for-of
`for ( const value of iterable)` syntax. ๐ง -> TypeError
Last updated
Was this helpful?
`for ( const value of iterable)` syntax. ๐ง -> TypeError
Last updated
Was this helpful?
Was this helpful?
JSโฉ syntax โฉ for loops โฉ for-of
for (const value of iterable) {} // loop over "values"
for (lvalue of iterable) {} // lvalue can be used
for (const [key, value] of aMap) {} // iterate over a Map.
Object.entries()
โ Object.keys()
+ Object.values()
for-in (loop over keys)
for-of (loop over values)
for (let key in object) {} // loop over "keys"
for (let value of object) {} // loop over "values"
// ^ ^ // โญ๏ธ ( ... )