Skip to content

Instantly share code, notes, and snippets.

@alexeyraspopov
Created November 30, 2014 23:24
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 alexeyraspopov/3c52bc23e057df229cd4 to your computer and use it in GitHub Desktop.
Save alexeyraspopov/3c52bc23e057df229cd4 to your computer and use it in GitHub Desktop.
var slice = Array.prototype.slice;
function curry(f){
var n = f.length;
return function curried(as){
return function(){
var args = as.concat(slice.call(arguments))
return args.length < n ? curried(args) : f.apply(null, args);
};
}([]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment