4 ms·
I'm not yet convinced that it's just syntactic sugar. For example, what (generic) code is `super` syntactic sugar for? Even if it is just syntactic sugar, that
by djacobs 11y ago
I'm not yet convinced that it's just syntactic sugar. For example, what (generic) code is `super` syntactic sugar for?
Even if it is just syntactic sugar, that syntactic sugar makes it much more approachable for devs who want to use classical inheritance (not that I'd encourage that).
- secoif 11y ago> what (generic) code is `super` syntactic sugar for? super.propertyOnSuper ~= this.__proto__.propertyOnSuper super() in constructor ~= ParentConstructor.call(this) and some tools provide such things like this.super_: https://github.com/isaacs/inherits/blob/3af5a10c6b51f9e99d9f90394645d7ea630d5eaa/inherits_browser.js#L17 https://github.com/isaacs/inherits/blob/3af5a10c6b51f9e99d9f...
- djacobs 11y agoThanks for the response. If the choice is between manually specifying that (type of) code for every kind of object (and likely moving to a #create factory method) or using a native syntax for class declaration, I can see why people would choose the latter.