I'm trying to set default values on an uninitialized array using the map function but it doesn't seem to work, any ideas on how to set default values?
Consider this code snippet I tried in Chrome console.
> var N = 10;
> var x = new Array(N);
> x
[undefined x 10]
> x.map(function(i) { return 0;});
[undefined x 10]
I was expecting the array to be initialized to 0's.