Hint
Destructuring methods detaches them from their object. Always bind or use .call() when passing methods as callbacks.
class Greeter {
constructor(name) { this.name = name; }
greet() { return 'Hi, ' + this.name; }
}
const g = new Greeter('Alice');
console.log(g.greet());
const { greet } = g;
console.log(greet?.call(g));Hi, Alice Hi, Alice
Explanation: g.greet() has this = g (correct). Destructuring detaches the method but .call(g) explicitly provides the context.
Key Insight: Destructuring methods detaches them from their object. Always bind or use .call() when passing methods as callbacks.