Step by step explanation of the ES6 arrow function syntax.
#javascript#es6
// 1. We start here with the standard functionfunction(a+b){returna+b;}// 2. Drop the "function" and insert the "=>" after the arguments(a,b)=>{returna+b};// 3. Move the function body to a single line. One line arrow functions will automatically return the output. This allows you to drop the "return", curly brackets and semicolon.(a,b)=>a+b