Inheritance III

PHOTO EMBED

Wed Aug 17 2022 05:06:45 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

class HospitalEmployee {
  constructor(name) {
    this._name = name;
    this._remainingVacationDays = 20;
  }
  
  get name() {
    return this._name;
  }
  
  get remainingVacationDays() {
    return this._remainingVacationDays;
  }
  
  takeVacationDays(daysOff) {
    this._remainingVacationDays -= daysOff;
  }
}

class Nurse extends HospitalEmployee {
  constructor(name,certifications) {
    super(name);
    //super(remainingVacationDays);
    this._certifications = certifications;
  }
}
const nurseOlynyk = new Nurse('Olynyk', ['Trauma', 'Pediatrics']); 
console.log(nurseOlynyk._certifications);
content_copyCOPY