I\'m just learning how to use JS higher-order functions (map, forEach, reduce, etc), and have stumbled into confusion. I\'m trying to write a simple \'range\' function, but
The array is defined with 4 entires each of which is undefined.
Map will not iterate over undefined entires, it skips them.
callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes that are undefined, those which have been deleted or which have never been assigned values.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map