DEV Community

Discussion on: Classical inheritance vs Prototype delegation in JavaScript

Collapse
 
alekseiberezkin profile image
Aleksei Berezkin

With private members classes are now more than just a sugar

Collapse
 
peerreynders profile image
peerreynders

JS classes are not “just syntactic sugar”

Also some things are natively implemented to be created via a class rather than a constructor function - so in the case of HTMLElement one has to use Reflect.construct() to create an instance from (transpiled) ES5.

That said in JavaScript Classes are a template for creating objects - not classes in the sense of class-based object orientation where "class membership" remains static for the lifetime of the object.