Created
December 22, 2016 16:01
-
-
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.
This file contains hidden or 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
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