Skip to content

Instantly share code, notes, and snippets.

@Axighi
Created Mar 21, 2017
Embed
What would you like to do?
Function.prototype.curry = function() {
if (arguments.length < 1) {
return this;
}
const self = this;
const args = toArray(arguments);
return function() {
return self.apply(this, args.concat(toArray(arguments)));
}
}
function toArray(args) {
return Array.prototype.slice.call(args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment