Hint
this is determined by HOW the function is called, not where it was defined.
const obj = {
name: 'Alice',
greet() {
console.log(this.name);
}
};
const greet = obj.greet;
greet();undefined
Explanation: When greet is extracted from the object and called as a plain function, this is undefined (strict mode) or the global object (non-strict). Either way, this.name is undefined.
Key Insight: this is determined by HOW the function is called, not where it was defined.