Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Last active April 20, 2019 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeBelt/2bc09175d87344c77124c53e185801b9 to your computer and use it in GitHub Desktop.
Save codeBelt/2bc09175d87344c77124c53e185801b9 to your computer and use it in GitHub Desktop.
const numberArray = new Array(10).fill(1);
console.log(numberArray);
const numberArray = Array.from({length: 100}, (_, index) => index);
console.log(numberArray);
const numberArray = [...Array(150).keys()];
console.log(numberArray);
const stringArray = 'i'.repeat(5).split('')
console.log(stringArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment