Hint
Methods only keep their this when called on the object. Extract them and this is lost.
function Person(name) {
this.name = name;
}
Person.prototype.greet = function() {
return 'Hi, I am ' + this.name;
};
const p = new Person('Alice');
const greet = p.greet;
console.log(p.greet());
console.log(greet());Hi, I am Alice Hi, I am undefined
Explanation: p.greet() calls it as a method β this = p. greet() calls it as plain function β this = global/undefined, so this.name = undefined.
Key Insight: Methods only keep their this when called on the object. Extract them and this is lost.