Created
June 2, 2009 01:26
-
-
Save swannodette/121927 to your computer and use it in GitHub Desktop.
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.implement({ | |
partial: function(bind, args) { | |
var self = this; | |
args = $splat(args); | |
return function() { | |
return self.apply(bind, args.concat($A(arguments))); | |
}; | |
} | |
}); | |
// function add(a, b) {return a + b;} | |
// add.partial(null, 1)(2) -> will return 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment