Skip to content

Instantly share code, notes, and snippets.

@phil303
Last active December 19, 2015 17:39
Show Gist options
  • Save phil303/5992925 to your computer and use it in GitHub Desktop.
Save phil303/5992925 to your computer and use it in GitHub Desktop.
curry method
Function.prototype.curry = function () {
var fn = this, args = Array.prototype.slice.call(arguments);
return function () {
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments)));
};
};
var add = (function(a, b) { return a +b; }).curry(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment