I found strange behavior (tested in Chrome)
[1,2].map(function() { console.log(arguments); })
and this is normal - well, as in the documentation But
(new Array(20)).map(function() { console.log(arguments); })
It does not use a callback (no action, the debugger inside does not work, etc.). Why??
The syntax new Array(arrayLength) should create an array with the given length. And so it is. But what about .map ?
javascript arrays
Vasiliy Vanchuk
source share