Most languages don't have sparse arrays so it's really weird.
> Would it make more sense to you with a very slightly less arbitrary example, perhaps arr = ['Value for 0', 'Value for 1', , 'Value for 3', 'Value for 4']; instead of simple mapping ints to ints?
You'd usually put an explicit `null` there, especially as HOFs skip "empty" array cells so
['Value for 0', 'Value for 1', , 'Value for 3', 'Value for 4'].map(_=>1)
Most languages don't have sparse arrays so it's really weird.
> Would it make more sense to you with a very slightly less arbitrary example, perhaps arr = ['Value for 0', 'Value for 1', , 'Value for 3', 'Value for 4']; instead of simple mapping ints to ints?
You'd usually put an explicit `null` there, especially as HOFs skip "empty" array cells so
returns which is rarely expected or desirable.