Skip to content

Instantly share code, notes, and snippets.

@zckkte
Created March 13, 2021 17:01
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 zckkte/5545c648dfeb035478c86ee158705b5a to your computer and use it in GitHub Desktop.
Save zckkte/5545c648dfeb035478c86ee158705b5a to your computer and use it in GitHub Desktop.
function curry(fn) {
return function curriedFn(...args) {
if (fn.length !== args.length) {
return curriedFn.bind(null, ...args);
}
return fn.apply(null, args);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment