As title say, why can't I map a array which contain undefined
item?
var foo = new Array(3);
// [ , , ]
var bar = [null, null, null];
// [null, null, null]
foo.map(function(val){return 'test'});
// [ , , ]
bar.map(function(val){return 'test'});
// ['test', 'test', 'test']
maybe the foolish question, but I really want to know the reason.
thanks.