Skip to content

Instantly share code, notes, and snippets.

@nguyenit67
Last active October 8, 2021 02:00
Show Gist options
  • Save nguyenit67/7a609ca9afebd52e4d89bbcd80637a0e to your computer and use it in GitHub Desktop.
Save nguyenit67/7a609ca9afebd52e4d89bbcd80637a0e to your computer and use it in GitHub Desktop.
Array init non-empty array with N-size
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