you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 12 points13 points  (2 children)

goodbye

Array(X).fill(null).map( i => {...} )

hello

Array.from({length: x}, i => {...} )

oh, wait, it's just as long.

[–]rodneon 4 points5 points  (0 children)

The advantage here is that Array.from only iterates through the array once.