Getter

PHOTO EMBED

Wed Aug 17 2022 04:42:52 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

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



}


const surgeonRomero = new Surgeon('Francisco Romero', 'Cardiovascular');
const surgeonJackson = new Surgeon('Ruth Jackson', 'Orthopedics');
content_copyCOPY