Skip to content

Instantly share code, notes, and snippets.

@runzway
Created April 5, 2014 08:37
Show Gist options
  • Save runzway/9989119 to your computer and use it in GitHub Desktop.
Save runzway/9989119 to your computer and use it in GitHub Desktop.
js array generator
/*
daca n = 5
returns [0, 1, 2, 3, 4]
*/
var arr = Array.apply(null, Array(n));
return arr.map(function (x, i) { return i });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment