Hint
Arrow functions have no own this β they capture it from the surrounding scope at definition time.
const obj = {
name: 'Bob',
greet: () => {
console.log(this?.name);
},
greetRegular() {
console.log(this.name);
}
};
obj.greet();
obj.greetRegular();undefined Bob
Explanation: Arrow functions inherit this from their lexical scope (where they were defined). At the object literal level, this is the global object/undefined β not the object. greetRegular() uses this = obj correctly.
Key Insight: Arrow functions have no own this β they capture it from the surrounding scope at definition time.