Skip to content

Instantly share code, notes, and snippets.

@bradparker
Last active November 18, 2015 07:56
Show Gist options
  • Save bradparker/188d7dd002906f41f16e to your computer and use it in GitHub Desktop.
Save bradparker/188d7dd002906f41f16e to your computer and use it in GitHub Desktop.
const range = (start, end) =>
Array.from({
length: end - start
}).map((_, index) => (index + start))
const sum = nums =>
nums.reduce((total, num) => total + num)
sum(range(20, 100))
// => 4760
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment