Created
May 9, 2020 07:40
-
-
Save zaetrik/c843cbd0bb620d78a3c2198c899f8ee4 to your computer and use it in GitHub Desktop.
Currying Example
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 add = (x, y) => x + y | |
const addCurried = (x) => (y) => x + y | |
// Or to make it more clear we can write it like this => | |
function takeInFirstParameter(x) { | |
return function takeInSecondParameter(y) { | |
return x + y | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment