I feel like recent changes in the language (ES6+) introduce new features that don't have the flexibility as the pre ES6 language that we're used to.
For example, [`super` is static and inflexible]( https://esdiscuss.org/topic/the-super-keyword-doesnt-work-as-it-should) which is not inline with how `this` works. Object initializer methods are also limited. Suppose I want to define an object that contains various constructors. I would be inclined to use object-initializer shortcuts: ```js let classes = { Cat() {}, Dog() {}, Bird() {} } ``` but this doesn't work: ```js new classes.Dog() // Uncaught TypeError: classes.Dog is not a constructor ``` So, here's another failure of intuition (`super` being static was also not intuitive). We can fix this by writing: ```js function Cat() {} function Dog() {} function Bird() {} let classes = { Cat, Dog, Bird } ``` but that's not as convenient. What's the reason why we shouldn't be able to do that? I feel like JavaScript is being restricted in undesirable ways. I love JavaScript because it has always been so flexible, and I would expect the new features to continue being flexible. That's what makes JavaScript great. */#!/*JoePea
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

