4/12, what's wrong with my code?


#1
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(){
 this._remainingVacationDays-= this._daysOff;
  }
}
 

const surgeonCurry = new Surgeon('Curry', 'Cardiovascular');
const surgeonDurant = new Surgeon('Durant', 'Orthopedics');

#2

Please post a link to the exercise this is from. Just having your code is not enough information for us to go by. We need to know the exact exercise and any error messages. Thanks.


#3

https://www.codecademy.com/courses/learn-javascript-classes/lessons/classes/exercises/methods?action=lesson_resume&course_redirect=introduction-to-javascript


#4

so??? anybody there?


#5

_daysOff is not a valid property. The variable should be daysOff which is defined in the parameter.


#6

Ok, but it still doesn’t work

https://www.codecademy.com/courses/learn-javascript-classes/lessons/classes/exercises/methods?action=lesson_resume&course_redirect=introduction-to-javascript


#7

i already got it, thanks.


#9