Skip to content

Instantly share code, notes, and snippets.

@didacus
Created February 7, 2019 08:59
Show Gist options
  • Save didacus/a92a6fd973e998ca9a790a615b125d3d to your computer and use it in GitHub Desktop.
Save didacus/a92a6fd973e998ca9a790a615b125d3d to your computer and use it in GitHub Desktop.
ES2015 Spread operator — Do it 'x' times
const dotIt = number => {
const res = [ ...Array(number) ].map((_, i) => {
return i * number
})
return res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment