Created
October 20, 2017 01:16
-
-
Save songz/0a6d9c5275ce447808a46d645a6818cf to your computer and use it in GitHub Desktop.
Curry
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
const curryFunc = (fun, inputs=[]) => { | |
if(inputs.length == fun.length) return fun(...inputs); | |
return (...args) => curryFunc(fun, inputs.concat(args)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment