Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created June 2, 2009 01:26
Show Gist options
  • Save swannodette/121927 to your computer and use it in GitHub Desktop.
Save swannodette/121927 to your computer and use it in GitHub Desktop.
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