Skip to content

Instantly share code, notes, and snippets.

@zeusdeux
Last active December 22, 2015 21:49
Show Gist options
  • Save zeusdeux/6536246 to your computer and use it in GitHub Desktop.
Save zeusdeux/6536246 to your computer and use it in GitHub Desktop.
/* curry method */
Function.prototype.curry = function() {
var f = this, args = [].slice.call(arguments,0);
return function(){
return f.apply(this, args.concat([].slice.call(arguments,0)));
};
};
/* uncurryThis method */
Function.prototype.uncurryThis = function(){
var f = this;
return function(){
return f.apply(arguments[0],[].slice.call(arguments,1));
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment