javascript - What's the difference between `[undefined, undefined]` and `new Array(2)`? -


why this:

[undefined, undefined].map(function(i) { console.log(i); }) 

produces expected output (2 times undefined), this:

(new array(2)).map(function(i) { console.log(i); }) 

doesn't?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -