Created
February 6, 2021 11:58
-
-
Save sidouglas/b45120464c95215c2484e1c291649519 to your computer and use it in GitHub Desktop.
Prefilling an Array with Values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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