Skip to content

Instantly share code, notes, and snippets.

@mduvall
Created January 28, 2012 08:56
Show Gist options
  • Save mduvall/1693584 to your computer and use it in GitHub Desktop.
Save mduvall/1693584 to your computer and use it in GitHub Desktop.
partial application in js
// function currying
function curry(fn) {
var s = Array.prototype.slice;
var vargs = s.call(arguments, 1);
return function() {
var nargs = s.call(arguments);
var args = vargs.concat(nargs);
return fn.apply(null, args);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment