Skip to content

Instantly share code, notes, and snippets.

@Maccauhuru
Last active January 16, 2019 10:41
Show Gist options
  • Save Maccauhuru/44d068dbef6968089ed928d94716d706 to your computer and use it in GitHub Desktop.
Save Maccauhuru/44d068dbef6968089ed928d94716d706 to your computer and use it in GitHub Desktop.
ES6 Arrow Functions More Examples
//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