javascript arrow function with parameter code example
Example 1: arrow function javascript
const suma = (num1, num2) => num1+num2
console.log(suma(2,3));
Example 2: arrow function map js
const exampleArray = ['aa','bbc','ccdd'];
console.log(exampleArray.map(a => a.length));
Example 3: arrow func in javascript
const greet = (who) => {
return `Hello, ${who}!`;
};
greet('Eric Cartman');
Example 4: arrow function javascript
function (param) {
var a = param * 3;
return a;
}
(a, b) => {
let c = (a * b) + 3;
return c;
}