Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Learning Arrow function Syntax

// Traditional Function
function bob (a){
  return a + 100;
}
// 1. Remove the word "function" and place arrow between the argument and opening body bracket
// Arrow Function
// 2. Remove the body braces and word "return" -- the return is implied
// 3. Remove the argument parentheses

// Arrow Function
let bob = a => a + 100;
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Learning #Arrow #function #Syntax
ADD COMMENT
Topic
Name
4+4 =