arrow function javascript mdn code example
Example 1: arrow function javascript
const suma = (num1, num2) => num1+num2
console.log(suma(2,3));
//5
Example 2: concise body arrow functions javascript
const plantNeedsWater = day => day === 'Wednesday' ? true : false;
//If only 1 Parameter no () needed
//Single line return is implicit
//Single line no {} needed
Example 3: arrow function javascript
hello = () => {
return "Hello World!";
}