Skip to content

Instantly share code, notes, and snippets.

@npow
Created July 12, 2012 01:18
Show Gist options
  • Save npow/3094996 to your computer and use it in GitHub Desktop.
Save npow/3094996 to your computer and use it in GitHub Desktop.
Curry in JavaScript
Function.prototype.curry = function() {
var fn = this;
var args = [].slice.call(arguments, 0);
return function() {
return fn.apply(this, args.concat([].slice.call(arguments, 0)));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment