Created
August 8, 2018 15:47
-
-
Save chranderson/d352cc97cca3eceeb3a437c4f45d7770 to your computer and use it in GitHub Desktop.
create indexed array by count
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
const createArray = count => Array(count).fill().map((x, i) => i) | |
const tenItemArray = createArray(10) | |
console.log(tenItemArray) | |
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment