Just want to add some test cases to raina77ow's excellent answer.
Indeed, new Array(5) doesn't alloc 5 properties in the Array object.
It's doesn't matter whether you use underscore or plain javascript Array.prototype.map (in decent browser of course).
Here are test cases in node.js
new Array(2) just returns an empty object (no keys) with 2 (kind of fake) placeholders
> var a = new Array(2);
> a;
[ , ]
> a.length;
2
> Object.keys(a);
[]
the map result is also an empty object (no keys) with 2 placeholders
> var result = a.map(Math.random);
> result;
[ , ]
> result.length;
2
> Object.keys(result);
[]
Why the result is an array object of length 2, even when there is nothing done?
Read the Array.prototype.map polyfill implmentation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
The map result was created as var res = new Array(source_array_length);
In addition, map works with a filled Array even when values are undefined
> [undefined, undefined].map(Math.random);
[ 0.6572469582315534, 0.6343784828204662 ]
Ok, let's also test sparse array, length is 2 but it only contains one key '1'.
> var a = []; a[1] = 'somthing';
> a;
[ , 'somthing' ]
> a.length
2
> Object.keys(a);
[ '1' ]
The map result returns an array of length 2, but only one key '1', only one Math.random is fired!
> var result = a.map(Math.random);
undefined
> result.length
2
> result
[ , 0.8090629687067121 ] // only one Math.random fired.
> Object.keys(result);
[ '1' ]