this in Arrow Functions
Arrow functions resolve this from their surrounding lexical environment. Calling an arrow with call, apply or bind does not replace that lexical this.
Use an arrow to retain an enclosing receiver deliberately, not to declare every object method.
See the mechanism
articleFollow one example
makeReader is an ordinary method called with article as this. Its returned arrow uses that surrounding this, so both calls read Morning. The later call receiver does not override it. An arrow written directly in an object literal would instead capture the literal’s surrounding this, not the object by virtue of being a property.
Predict, change and check
Predict: What changes if the returned arrow becomes an ordinary function and is called with the other receiver?
Test your explanation: Make that replacement and use .call({title: "Night"}). Compare definition-time lexical access with call-time receiver selection.
The tasks below ask you to explain that result and apply the idea to different inputs.
Apply and distinguish
Lexical this is a captured relationship
An arrow reads this from its surrounding lexical environment. call, apply and bind cannot replace that arrow's this value as they can for an ordinary function. An arrow property in an object literal does not automatically capture the object literal as a receiver.
An arrow created inside an instance method or field initialization can deliberately retain the instance context, but it may also create per-instance function objects. Choose the relationship your API needs, not a blanket rule that arrows are always more modern methods. Test the same callback after detaching it from its original owner.
Check your understanding: State the input contract, identify the operation that changes the result, and give one boundary input that would distinguish the correct rule from the mistake described above.