Skip to content

Instantly share code, notes, and snippets.

@jimmy-collazos
Created August 1, 2018 07:32
Show Gist options
  • Save jimmy-collazos/a336db167eca57cd438a939fcd88316f to your computer and use it in GitHub Desktop.
Save jimmy-collazos/a336db167eca57cd438a939fcd88316f to your computer and use it in GitHub Desktop.
Helper function - curry()
export const curry = (
f,
arr = [],
length = f.length
) => (...args) => (
a => a.length === length && f(...a) || curry(f, a)
)([...arr, ...args]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment