Skip to content

Instantly share code, notes, and snippets.

@Sawtaytoes
Created September 20, 2018 02:49
Show Gist options
  • Save Sawtaytoes/92fc442c20c571ca0e42c4982800d4aa to your computer and use it in GitHub Desktop.
Save Sawtaytoes/92fc442c20c571ca0e42c4982800d4aa to your computer and use it in GitHub Desktop.
Dynamic currying function written for functional code (no `this` context).
curry = func => (...args) => (
args.length >= func.length
? func(...args)
: (...moreArgs) => curry(func)(...args.concat(moreArgs))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment