CLASSES Method Calls 5/12

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 surgeonCurry = new Surgeon('Curry', 'Cardiovascular');
const surgeonDurant = new Surgeon('Durant', 'Orthopedics');

console.log(surgeonCurry.remainingVacationDays); // 20    <--- Is that right?? I can't understand the sens of it, if we use surgeonCurry.takeVacationDays(3), which takes 3 from 20, i expected to see 17!


you do the subtraction, but you do nothing with the result this subtraction gives you


anyway, for education is it enough or i need to remake something? i don’t mind to remake something…

anyway, thanks for help-answer :slight_smile:


I would do something with the result of the subtraction, so that the output is displayed correctly