Last active
July 8, 2017 22:44
-
-
Save clucasalcantara/e3f7818a0d9bb8cee8ebe10436ec69ad to your computer and use it in GitHub Desktop.
currying-eveything!
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
// Thanks Matheus Marciglio: https://github.com/mtmr0x | |
// This is a regular and not curried function | |
const sum = function(x, y) => x + y | |
sum(1, 2) // 3 | |
// With Currying technique we transform that into a curried function | |
const currySum = (x) => (y) => x + y | |
currySum(1)(2) // 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment