Created
March 23, 2013 07:50
-
-
Save aaronfrost/5226884 to your computer and use it in GitHub Desktop.
Arrow Function - 10 - Multiple Lines need brackets
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)); | |
//NO BRACKETS FOR ONE LINES | |
let add = (x,y)=> { | |
if(x && y){ | |
console.log(x + y); | |
} | |
} | |
console.log(add(1,2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment