javascript lambda expressions code example
Example 1: arrow function rec
(param1, param2, …, paramN) => { statements }
(param1, param2, …, paramN) => expression
(singleParam) => { statements }
singleParam => { statements }
() => { statements }
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: concise body arrow functions javascript
const plantNeedsWater = day => day === 'Wednesday' ? true : false;