Why doesn't the last line of this code work? How can I make it work without changing Thing or obj? How can I assign a context-bound function invoking 'obj.getName' to the variable 'f' (that is, the expression 'f()' would result in the invocation of 'obj.getName').?
class Thing{
constructor(name) {this._name = name;}
getName() { return this._name;}
}
const obj = new Thing('a');
const f = obj.getName;
const name = f();