as-needed
do things, as needed
range
for const v of console;12345
take
for const v of console;// output: 1 2 3
console;// output: 1 2 3
map
for const v of console;// output:111213
reduce
for const v of console;// output:136
filter
for const v of console;// output:135
Note: take
, map
, reduce
, and filter
accept any iterable or array-like object.