Hint
Class methods are not auto-bound. Always bind in constructor or use arrow class fields.
class Counter {
count = 0;
increment() {
this.count++;
console.log(this.count);
}
}
const c = new Counter();
const inc = c.increment;
inc();TypeError: Cannot set properties of undefined
Explanation: Extracting the method loses the class instance as this. In strict mode (classes always use strict), this is undefined. Accessing undefined.count throws a TypeError.
Key Insight: Class methods are not auto-bound. Always bind in constructor or use arrow class fields.