Skip to content

Instantly share code, notes, and snippets.

@rendall
Created August 15, 2021 19:54
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 rendall/8060eab6707d9c0849b6849f9e85fa87 to your computer and use it in GitHub Desktop.
Save rendall/8060eab6707d9c0849b6849f9e85fa87 to your computer and use it in GitHub Desktop.
const curry = (fn, ...initialArgs) => (...args) => fn(...initialArgs, ...args);
// const add = (a, b) => a + b;
// const add5 = curry(add, 5);
// const result = add5(1) // 6
// https://programming-idioms.org/idiom/37/currying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment