Skip to content

Instantly share code, notes, and snippets.

@hokaccha
Created November 7, 2012 04:45
Show Gist options
  • Save hokaccha/4029616 to your computer and use it in GitHub Desktop.
Save hokaccha/4029616 to your computer and use it in GitHub Desktop.
function curry(fn, _this) {
return function(arg) {
return fn.bind(_this, arg);
}
}
function add(a, b, c) { return a + b + c }
var curried_add = curry(add);
var res = curried_add(1)(2, 3);
console.log(res); // => 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment