Last active
September 2, 2016 12:23
-
-
Save alanyoshida/a075e31189e5d93f24e3412180d2ce5e to your computer and use it in GitHub Desktop.
Javascript Lambda Functions
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
/* ES5 */ | |
var adder = function(x){ | |
return function(y){ | |
return x+y; | |
}; | |
} | |
adder(5)(5) | |
// 10 | |
/* ES6 */ | |
var adderEs6 = x => y => x+y; | |
adderEs6(6)(6) | |
// 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment