Created
July 14, 2011 21:23
-
-
Save SirPepe/1083493 to your computer and use it in GitHub Desktop.
JavaScript Curry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.curry = function(){ | |
if(arguments.length < 1) return this; | |
var args = Array.prototype.slice.call(arguments), | |
method = this; | |
return function(){ | |
return method.apply(this, args.concat(Array.prototype.slice.call(arguments))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment