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 thi
With .map(), undefined elements are skipped and not passed to the callback so if you have an array with no elements that actually contain anything, then the callback is never called.
From the ECMA script 262, 5.1 specification, section 15.4.4.19:
callbackfn is called only for elements of the array which actually exist; it is not called for missing elements of the array.