Skip to content

Instantly share code, notes, and snippets.

@songz
Created October 20, 2017 01:16
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 songz/0a6d9c5275ce447808a46d645a6818cf to your computer and use it in GitHub Desktop.
Save songz/0a6d9c5275ce447808a46d645a6818cf to your computer and use it in GitHub Desktop.
Curry
const curryFunc = (fun, inputs=[]) => {
if(inputs.length == fun.length) return fun(...inputs);
return (...args) => curryFunc(fun, inputs.concat(args));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment