Skip to content

Instantly share code, notes, and snippets.

@aaronfrost
Created March 23, 2013 07:45
Show Gist options
  • Save aaronfrost/5226864 to your computer and use it in GitHub Desktop.
Save aaronfrost/5226864 to your computer and use it in GitHub Desktop.
Arrow Function - 9 - Implicit return for one-liners
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