Learn
Way to go! Let’s review what you learned.
- Classes are templates for objects.
- Javascript calls a constructor method when we create a new instance of a class.
- Inheritance is when we create a parent class with properties and methods that we can extend to child classes.
- We use the
extends
keyword to create a subclass. - The
super
keyword calls theconstructor()
of a parent class. - Static methods are called on the class, but not on instances of the class.
In completing this lesson, you’ve taken one step closer to writing efficient, production-level JavaScript. Good luck as you continue to develop your skills and move into intermediate-level concepts.
Instructions
If you want extra practice with inheritance, take some time to create a Doctor
class that inherits from HospitalEmployee
. The properties and methods for the Doctor
class are listed below:
Doctor
- properties:
_name
,_remainingVacationDays
(set to20
insideconstructor()
),_insurance
- methods:
.takeVacationDays()
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.