Skip to content

Instantly share code, notes, and snippets.

@john-e
Last active May 30, 2017 12:22
Show Gist options
  • Select an option

  • Save john-e/da34aa20223d83fb2caa9a062c6802b2 to your computer and use it in GitHub Desktop.

Select an option

Save john-e/da34aa20223d83fb2caa9a062c6802b2 to your computer and use it in GitHub Desktop.
Trying out curry function in javascript
function curry (fn, ...args) {
if (fn.length == args.length) return fn(...args);
return (...args2) => {
return curry(fn, ...[...args, ...args2]);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment