Created
January 12, 2020 17:18
-
-
Save dyrkow/727eb0eefbb82daf0d084607f3921ba3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const curry = func => { | |
return function curried(...args) { | |
if (args.length >= func.length) { | |
return func.apply(this, args); | |
} | |
return (...subArgs) => curried.apply(this, args.concat(subArgs)); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment