Array(3)gives [ , , ]which has lengthof 3.
[1, 2, 3].forEach loops 3 times as expected.
However Array(3).forEach, [ , , ].forEachloops in general.
Why is this? I thought I discovered a way to do something nonce without using loops for, and I'm disappointed that it doesn't work!
source
share