Skip to content

Instantly share code, notes, and snippets.

@aaronfrost
Created March 23, 2013 07:50
Show Gist options
  • Save aaronfrost/5226884 to your computer and use it in GitHub Desktop.
Save aaronfrost/5226884 to your computer and use it in GitHub Desktop.
Arrow Function - 10 - Multiple Lines need brackets
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