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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -