Javascript Lambda Expression Example
var xa = function(a) {
return a;
}
var xl = a => a;
var x = () => { console.log("hi"); };
x();
//console.log(xl("hi"));
var sum = (a,b,c) => a+b+c;
console.log(sum(3,4,5));
setTimeout( function() { console.log("timeout");}, 200);
setTimeout(() => console.log("timeout lambda"), 200);
//function multiply(a,b) {
// return a*b;
//}
var multiply = (a,b) => a*b;
console.log(multiply(2,3));
(() => {
this.speed = 0;
setInterval( () => {
this.speed++;
console.log(this.speed);
}, 200
);
})();
Comments