Last active
February 3, 2019 11:47
-
-
Save anubhavsrivastava/9baa61b12abe8d8a952f762f886e477b to your computer and use it in GitHub Desktop.
Currying Add(2)(3) in JS
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
function add(x){ | |
return function (y){ | |
return x+y; | |
} | |
} | |
//ES6 version using arrow functions | |
const add = x=> y=>x+y; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment