Skip to content

Instantly share code, notes, and snippets.

@DrBoolean
Created October 6, 2015 18:02
Show Gist options
  • Select an option

  • Save DrBoolean/2e7cf17a862885549a7a to your computer and use it in GitHub Desktop.

Select an option

Save DrBoolean/2e7cf17a862885549a7a to your computer and use it in GitHub Desktop.
Debug_2
function curry(fx) {
var arity = fx.length;
function f1() {
var args = Array.prototype.slice.call(arguments, 0);
if (args.length >= arity) return fx.apply(null, args);
function f2() {
return f1.apply(null, args.concat(Array.prototype.slice.call(arguments, 0)));
}
return f2;
};
return f1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment