Last active
January 16, 2019 09:38
-
-
Save Maccauhuru/87d54cbf9f5dfd2e8d028f23b0344b49 to your computer and use it in GitHub Desktop.
Example Of Using An Arrow Function
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
//An ES6 Arrow function named addNumbers that accepts 2 input parameters | |
const addNumbers = (num1,num2) =>{ | |
let sum = num1 + num2; | |
return sum; | |
} | |
//To invoke the function,i will call its name (addNumbers) and give it 2 parameters | |
addNumbers(5,2); // will output : 7 | |
addNumbers(100,1); // will output : 101 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment