Classes and Inheritance Flashcards
1
Q
In JavaScript classes are _____
A
Functions!
2
Q
What is the foundation of every class?
A
The constructor function
3
Q
To create a sub-class what keyword do we need?
A
Extends
ex. class Child extends Parent { }
4
Q
Methods declared inside an object are not properties of the object, but properties of the object’s _____
A
Prototype
5
Q
What does super( ) do?
A
Super( ) tells a base’s constructor to be concerned with the sub-class’ attributes - and it allows us to get away from the confusing object.create(this, class) syntax.