Last active
January 8, 2019 15:15
-
-
Save Tombarr/4a67454e3940ff73bfefe1c0368c2eb2 to your computer and use it in GitHub Desktop.
Lambdas in Javascript
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
// Arrow functions with one parameter | |
[1, 2, 3].map(x => x * x); // [1, 4, 9] | |
// Arrow functions with multiple parameters | |
[1, 2, 3].reduce((x, s) => s + x); // 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment