lambda expression javascript code example
Example 1: es6 arrow function
const multiplyES6 = (x, y) => x * y;
Example 2: js lambda
function (a, b){
return a + b + 100;
}
(a, b) => a + b + 100;
let a = 4;
let b = 2;
function (){
return a + b + 100;
}
let a = 4;
let b = 2;
() => a + b + 100;
Example 3: Arrow Functions
const magic = function() {
return new Date();
};
const magic = () => {
return new Date();
};
const magic = () => new Date();
Example 4: js arrow function
hello = () => {
return "Hi All";
}