JavaScript Introducing ES2015 Classes Sub-Classes

Cathy Warner
Cathy Warner
2,346 Points

Setting properties in the constructor

Why does the constructor in Student need to set the name and age properties? Aren’t they already set by extending Person and then calling super(), since those properties are set in the Person constructor?

James Estrada
James Estrada
17,819 Points

I also have this question. If I remove the arguments passed to the super constructor (name and age), it works the same way as with them. Hope someone can answer our question.