Absolutely. The class keyword uses prototypes in its implementation. It's just "syntactic sugar", or a simpler way of using prototypes, but we're still using prototypes nonetheless. It's key to the core of OOP in JS.
I think it is, because, in the background, class still uses prototype chain etc. You might understand some things better (or debug faster) if you understand how it really works.
The class keyword is just different syntax for creating objects. Once the object is created it still uses the same prototypal inheritance objects always have.
Using the 'class' keyword without understanding prototypal inheritance is like building a house with no understanding of carpentry. Eventually something's going to break, and you won't know how to fix it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
With the advent of the
class
keyword in ES6, is it still necessary to understandprototype
and friends?Unfortunately yes, even with the nicer syntax it's still plain old prototype chain. They missed the historical opportunity to clean up this mess.
Absolutely. The class keyword uses prototypes in its implementation. It's just "syntactic sugar", or a simpler way of using prototypes, but we're still using prototypes nonetheless. It's key to the core of OOP in JS.
I think it is, because, in the background, class still uses prototype chain etc. You might understand some things better (or debug faster) if you understand how it really works.
The class keyword is just different syntax for creating objects. Once the object is created it still uses the same prototypal inheritance objects always have.
Using the 'class' keyword without understanding prototypal inheritance is like building a house with no understanding of carpentry. Eventually something's going to break, and you won't know how to fix it.