Last active
January 16, 2019 10:41
-
-
Save Maccauhuru/44d068dbef6968089ed928d94716d706 to your computer and use it in GitHub Desktop.
ES6 Arrow Functions More Examples
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
//Arrow function that uses an implicit return | |
const addNumbers = (num1,num2) => num1 + num2; | |
addNumbers(10,20); // 30 | |
//Arrow function that uses a 'return' keyword in the block body | |
const addSomeNumbers = (num1,num2) => { | |
let total = num1 + num2; | |
return total; | |
} | |
addSomeNumbers(10,20); // 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment