Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dtipson/5e96264b4a19802cfad9 to your computer and use it in GitHub Desktop.

Select an option

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