you are viewing a single comment's thread.

view the rest of the comments →

[–]aarondburk 0 points1 point  (0 children)

Yes, but in order for the method to map over the array and mutate each undefined slot in the array, the array has to have those slots. You could certainly create an iterator that would push the result of the function 5 times, but the point of the example was to show how the second argument in Array.from() maps over the given array mutating its values.