Skip to content

Instantly share code, notes, and snippets.

@pocotan001
Last active April 8, 2019 04:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Loop for N times
const n = 10
Array.apply(null, Array(n)).forEach( … )
// or
[...Array(n).keys()].forEach( … )
// or
Array(n).fill().forEach( … )
// or
Array.from({ length: n }).forEach( … )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment