I found it strange that
Array(100).map(function (_, i) { return i + 1; })
returns [undefined, undefined, ... , undefined]
rather than [1, 2, ..., 100]
, i. e. the mapping not happening. On the contrary, starting with an array of 100 undefined
works (demo).
Does Array(100)
returns something other than 100 undefined
elements?