Skip to content

Instantly share code, notes, and snippets.

@lazywithclass
Created August 22, 2011 09:24
Show Gist options
  • Save lazywithclass/1162002 to your computer and use it in GitHub Desktop.
Save lazywithclass/1162002 to your computer and use it in GitHub Desktop.
Partial function application
function partial(func /*, 0..n args */) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
var allArguments = args.concat(Array.prototype.slice.call(arguments));
return func.apply(this, allArguments);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment