Skip to content

Instantly share code, notes, and snippets.

@ax2mx
Last active August 26, 2024 11:50
Show Gist options
  • Select an option

  • Save ax2mx/76056658f84de647d5387999c148137c to your computer and use it in GitHub Desktop.

Select an option

Save ax2mx/76056658f84de647d5387999c148137c to your computer and use it in GitHub Desktop.
The most concise currying function in JavaScript so far
const curryPartial = (fn, ...args) =>
args.length >= fn.length
? fn(...args)
: (...rest) => curryPartial(fn, ...args, ...rest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment