Created
March 23, 2013 07:45
-
-
Save aaronfrost/5226864 to your computer and use it in GitHub Desktop.
Arrow Function - 9 - Implicit return for one-liners
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
let add = (x,y)=> x+y; | |
console.log(add(1,2)); | |
//When there is only line instruction | |
//in the Arrow Function body, you | |
//don't need the 'return' keyword | |
//to return the result of the expression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment