Last active
January 28, 2022 14:36
-
-
Save Gummiees/c7ba3b3c2779e28a1ab65de1e0a5299f to your computer and use it in GitHub Desktop.
Create a new array of defined length
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
// Create a new array of length X, that contains the index + 1 to the length. | |
const x = 10; | |
const numbers = new Array(x).fill(null).map((_,i)=> i + 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment