|
|
|
|
|
by moritzwarhier
349 days ago
|
|
The article misses even more nuance, independent from classes. If you define const o = { a: "Hello", b() { return this.a;} }
then o.a()
will return "Hello"while const b = o.b; // not a.b ...
b();
will throw an error.This predates generator functions and classes (which are only syntax sugar AFAIK). And it seems like a glaring omission giving the submission title. I'm ashamed though if it's in there and I missed it. The behavior is called "late binding". |
|