es6 function expressions code example
Example 1: arrow function in javascript
//function old way
function PrintName(name){
console.log("my name is ", name) ;
}
// Arrow function es6
const PrintName = (name) => {
return console.log("my name is " , name) ;
}
Example 2: arrow function map js
const exampleArray = ['aa','bbc','ccdd'];
console.log(exampleArray.map(a => a.length));
//Would print out [2,3,4]