Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dtipson/9f365dea119198a5f9c6 to your computer and use it in GitHub Desktop.
Save dtipson/9f365dea119198a5f9c6 to your computer and use it in GitHub Desktop.
Partially applied reduce with arrow functions.js
var reduce = fn => (Arr, acc) => Arr.reduce(fn, acc);
var add = reduce((acc,x)=>acc+x);
add([1,2,3],0);// -> 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment