Skip to content

Instantly share code, notes, and snippets.

@elclanrs
Created March 8, 2014 09:34
Show Gist options
  • Save elclanrs/9427884 to your computer and use it in GitHub Desktop.
Save elclanrs/9427884 to your computer and use it in GitHub Desktop.
function curry$(f, bound){
var context,
_curry = function(args) {
return f.length > 1 ? function(){
var params = args ? args.concat() : [];
context = bound ? context || this : this;
return params.push.apply(params, arguments) <
f.length && arguments.length ?
_curry.call(context, params) : f.apply(context, params);
} : f;
};
return _curry();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment