Skip to content

Instantly share code, notes, and snippets.

@forksofpower
Created October 14, 2020 16:47
Show Gist options
  • Save forksofpower/a0e517095195a8d0b55bc0935a7e9627 to your computer and use it in GitHub Desktop.
Save forksofpower/a0e517095195a8d0b55bc0935a7e9627 to your computer and use it in GitHub Desktop.
Iterate over values from 0 to n
  [...Array(n)].map((_,i) => i+1).map(x => { ... })

is similar to

  for(let i = 1; i <= n; i++) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment