Lambda saysArrow functions are concise and inherit this from their surrounding scope.
const add = (a, b) => a + b — no function keyword, implicit return for one expression. Crucially, arrows don't have their own this; they use the enclosing scope's, which fixes the classic callback-this bug. They can't be used as constructors and have no arguments object.
Power-ups you unlock
Concise: (a,b) => a + b · implicit return
No own this — inherits from the surrounding scope
Great for callbacks (fixes this bugs)
Not for constructors; no arguments object
The Mutator attacks — common mistakes
Using an arrow as an object method needing its own this
Forgetting parens around an object literal return
Expecting an arguments object inside an arrow
Boss battleConvert a function expression callback to an arrow and use it in map.