Return to Snippet

Revision: 38213
at December 28, 2010 20:45 by jofan


Initial Code
function curry(fn) {
  var slice = Array.prototype.slice,
      stored_args = slice.call(arguments, 1);
  return function () {
    var new_args = slice.call(arguments),
        args = stored_args.concat(new_args);
    return fn.apply(null, args);
  };
}

Initial URL
curry

Initial Description
From JavaScript Patterns

Initial Title
JavaScript Curry

Initial Tags
js

Initial Language
JavaScript