Behavior of "this" keywordthis is a weird keyword that behaves a little differently in JavaScript compared to other languages. this serves as an identity function, providing our neighborhoods a way of referring to themselves. this can be used to refer to the object being created by a constructor.
Lambda functions
Lambda expressions simply are expressions that create functions. In JavaScript pre-ES6 we have function expressions that give us an anonymous function (a function without a name).
var anon = function (a, b) { return a + b };
One of the major advantages of arrow functions is that it does not have it's own this value. It's this is lexically bound to the enclosing scope.
Behavior of "this" keyword
this
is a weird keyword that behaves a little differently in JavaScript compared to other languages.this
serves as an identity function, providing our neighborhoods a way of referring to themselves.this
can be used to refer to the object being created by a constructor.Lambda functions Lambda expressions simply are expressions that create functions. In JavaScript pre-ES6 we have function expressions that give us an anonymous function (a function without a name).
var anon = function (a, b) { return a + b };
One of the major advantages of arrow functions is that it does not have it's ownthis
value. It'sthis
is lexically bound to the enclosing scope.