Created
September 15, 2019 22:58
-
-
Save VinayakBagaria/c68dd6a4e7d45caa418e1f8656743c1e to your computer and use it in GitHub Desktop.
Generate an array with a range of numbers
This file contains 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 range(end) { | |
return Array.from({ length: end }, (_, index) => index); | |
} | |
range(4); // => [0, 1, 2, 3] | |
/* | |
map function that simply returns the current index. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Keybase proof
I hereby claim:
To claim this, I am signing this object:
with the key ASB9RXxw0-FC4iSzb11Qm28jo37wm2U1WvM5iBLzeumajAo, yielding the signature:
And finally, I am proving ownership of the github account by posting this as a gist.
My publicly-auditable identity:
https://keybase.io/christophers99
From the command line:
Consider the keybase command line program.
# look me up keybase id christophers99