Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Created February 6, 2021 11:58
Show Gist options
  • Save sidouglas/b45120464c95215c2484e1c291649519 to your computer and use it in GitHub Desktop.
Save sidouglas/b45120464c95215c2484e1c291649519 to your computer and use it in GitHub Desktop.
Prefilling an Array with Values
Array.from({length: 5}, (_,index) => ++index) // length of 5, and a callback to fill a value [1,2,3,4,5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment