Q11: How do ES6 Classes relate to Prototypal Inheritance?
ES6 Classes are syntactic sugar built on top of prototypal inheritance. Class methods are stored on the constructor's prototype property, and the extends keyword establishes prototype inheritance between prototype objects.
Key Takeaways
- Classes provide cleaner syntax over function prototypes.
- Under the hood, classes use prototypal delegation and function constructors.
Knowledge Check
Where are methods defined inside an ES6 class body attached?