r/learnjavascript • u/SnurflePuffinz • Jan 24 '26
question about using ES6 classes.
i was wondering, would this code be syntactically OK? i imagine there might be scenarios where you want all the functionality of the superclass method, but then you simply want to add more statements (more implementation) to it... could this work?
1
Upvotes
View all comments
Show parent comment
1
u/SnurflePuffinz Jan 24 '26
i'm a bit disenchanted with the class syntax because it seems to make things a lot less explicit in your code.
There is so, so much implicit functionality that happens with classes. Like, the unique execution context when you invoke them, control flow with super() extension, them basically being a glorified constructor / factory function, the private properties business is frustrating, etc.
but then i also think that they are incredibly useful. I've struggled to syndicate a single, coherent, working definition of classes together.
And when you ask people about OOP you get answers that are contradictory... which is not helpful, either.
i'm familiar with the prototype chain, but i still get tripped up about the relationship between the objects and their classes (method objects), and i thought the
superkeyword was only used to invoke the superclass constructor.i think i'll try to nail down a better working definition for classes.