Skip to content

Instantly share code, notes, and snippets.

@Cauterite
Created January 8, 2017 00:15
Show Gist options
  • Save Cauterite/87e56c77f4803704704ebb9ad95c3e49 to your computer and use it in GitHub Desktop.
Save Cauterite/87e56c77f4803704704ebb9ad95c3e49 to your computer and use it in GitHub Desktop.
Array(5)
-> [<5 empty slots>]
[...Array(5)]
-> [undefined, undefined, undefined, undefined, undefined]
[...Array(5)].map((_, X) => X)
-> [0, 1, 2, 3, 4]
[...Array(5).keys()]
-> [0, 1, 2, 3, 4]
Object.keys([...Array(5)])
-> ["0", "1", "2", "3", "4"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment