I found strange behavior ( tested at Chrome )
[1,2].map(function() { console.log(arguments); })
// [1, 0, Array[2]]
// [2, 1, Array[2]]
// [undefined, undefined]
and that's ok -- ok as in documentation But
(new Array(20)).map(function() { console.log(arguments); })
//[undefined × 20]
It doesn't use callback ( no actions, debugger
inside doesn't work etc. ). Why??
Syntax new Array(arrayLength)
should create array with given length. And it does. But what with .map
?