List all hospital employees


#1

Just wondering if there is a simple way to log all of the hospital employees. HospitalEmployees being the parent class and doctors and nurse as sub classes. Then I have one doctor and one nurse.

Is there a built-in way to do it or should I make a method? How would I check if a class has a parent class?


#2

Whenever you start making new classes, you’ll have to start making your own methods.
Your cpu will know how to print an integer, it has no idea what you might want printed for an object called “HospitalEmployees”
Should it print their names and id’s? More? Less?
In what order or format?
It’s up to you to tell the cpu how to print a hospital employee


#3

Is an object aware of it’s class though? I can’t console.log(nurseOlynyk.class) and have Nurse logged can I?

Does this mean I have to add a method to the constructor that would push that employee to a Nurse Array?