Skip to content

Instantly share code, notes, and snippets.

@ericchernuka
Created September 22, 2018 20:22
Show Gist options
  • Save ericchernuka/d74dfef819c6c43c7688ed8288329acf to your computer and use it in GitHub Desktop.
Save ericchernuka/d74dfef819c6c43c7688ed8288329acf to your computer and use it in GitHub Desktop.
ES6 Range Generator
const range = n => Array.from({length: n}, (value, key) => key)
const range = (n, cb = (value, index) => index) => Array.from({length: n}, cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment