Skip to content

Instantly share code, notes, and snippets.

@dyrkow
Created January 12, 2020 17:18
Show Gist options
  • Save dyrkow/727eb0eefbb82daf0d084607f3921ba3 to your computer and use it in GitHub Desktop.
Save dyrkow/727eb0eefbb82daf0d084607f3921ba3 to your computer and use it in GitHub Desktop.
export const curry = func => {
return function curried(...args) {
if (args.length >= func.length) {
return func.apply(this, args);
}
return (...subArgs) => curried.apply(this, args.concat(subArgs));
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment