Last active
May 24, 2018 14:12
-
-
Save PeterNMcArthur/5cacefa34e3e3d4dad2f514f2eed003b to your computer and use it in GitHub Desktop.
A function that curries anything you pass in to it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const curry = fn => (...args) => args.length >= fn.length ? fn(...args) : (...nxtArgs) => curry(fn)(...args, ...nxtArgs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment