Skip to content

Instantly share code, notes, and snippets.

@inooid
Created December 22, 2016 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inooid/ad97131bacb5d266d4d48db19fe2775a to your computer and use it in GitHub Desktop.
Save inooid/ad97131bacb5d266d4d48db19fe2775a to your computer and use it in GitHub Desktop.
Pretty cool way to generate an array with a bunch of numbers as values.
function arrayGenerator(length) {
return Array.apply(null, { length: length }).map(Number.call, Number)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment