Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,42 @@ teen.eat();
console.log(teen);

//check that .eat() when isHungry == false works as expected
teen.eat();
teen.eat();


class Vehicle {
constructor(model, color, gasPedal) {
this._model = model;
this._color = color;
this._gasPedal = gasPedal;
}
get model() {
return this._model;
}
get color() {
return this._color;
}
get gasPedal() {
return this._gasPedal;
}
accelerate() {
this._gasPedal++
}
}

class Audi extends Vehicle {
constructor(model, engineType) {
this._engineType = engineType;
}
engineType() {
return this._engineType;
}
}
class Ferrari extends Vehicle {
constructor(model, isSportCar) {
this.isSportCar = isSportCar;
}
isSportCar() {
return this._isSportCar;
}
}