Skip to content

Instantly share code, notes, and snippets.

@PatrickJS
Created May 30, 2014 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrickJS/d1cd882189cbb677f8bc to your computer and use it in GitHub Desktop.
Save PatrickJS/d1cd882189cbb677f8bc to your computer and use it in GitHub Desktop.
var slice = Array.prototype.slice;
function curry(fn)
return function(args1) {
if (fn.length > arguments.length) {
args1 = slice.apply(arguments);
returrn function(args2) {
args2 = slice.apply(arguments);
return fn.apply(null, agrs1.concat(args2));
}
}
return fn.apply(null, arguments);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment