Instantly share code, notes, and snippets.
[...Array(n)].map((_,i) => i+1).map(x => { ... })
is similar to
for(let i = 1; i <= n; i++) { ... }