Skip to content

Instantly share code, notes, and snippets.

@granmoe
Last active April 16, 2018 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save granmoe/33e31467490084a8f88a9f2433b239b5 to your computer and use it in GitHub Desktop.
Save granmoe/33e31467490084a8f88a9f2433b239b5 to your computer and use it in GitHub Desktop.
const reduce = (reducer, accumulator) => arr => {
const [first, ...rest] = arr
return arr.length
? reduce(reducer, reducer(accumulator, first))(rest)
: accumulator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment