Last active
May 22, 2018 17:42
-
-
Save EdwinGuzman/5f63be3a1e4502fb5faca5374f4944b3 to your computer and use it in GitHub Desktop.
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 makeCurry = (fn) => { | |
const slice = [].slice; | |
return function curriedFn() { | |
let args = slice.call(arguments); | |
if (args.length < fn.length) { | |
return () => { | |
return curriedFn.apply(null, args.concat(slice.call(arguments))); | |
}; | |
} | |
return fn.apply(null, args); | |
}; | |
}; | |
const volume = (length, width, height) => { | |
return length * width * height; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment