Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created April 11, 2019 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/d74d39ee977f62899bf07b1f43199433 to your computer and use it in GitHub Desktop.
Save codecademydev/d74d39ee977f62899bf07b1f43199433 to your computer and use it in GitHub Desktop.
Codecademy export
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 = this._remainingVacationDays - daysOff;
}
}
const surgeonCurry = new Surgeon('Curry', 'Cardiovascular');
const surgeonDurant = new Surgeon('Durant', 'Orthopedics');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment