Last active
October 8, 2021 02:00
-
-
Save nguyenit67/7a609ca9afebd52e4d89bbcd80637a0e to your computer and use it in GitHub Desktop.
Array init non-empty array with N-size
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
const LEN = 1000; | |
// First choice | |
[...Array(12).keys()] | |
// Another choice | |
Array.from({length: LEN}) | |
Array.from(Array(LEN)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment