/*The class Puppy needs two methods.
The getsTreat method should increase happiness by 20, then return the new happiness value.
The takesNap method should decrease energy by 45 and increase behavior by 15.
Make sure you make the puppy take his nap in order to change his energy and behavior levels*/
/* When I console.log(Charles) after the construction of the Puppy Class it returns :
“Puppy { happiness: 75, energy: 25, behavior: 30 }”
which is the value at the initial construction. Am I improperly calling the “getTreat” and “takesNap” methods to change the puppies value?? Do I need to add a return statement in these methods??*/
class Puppy {
constructor(happiness, energy, behavior) {
this.happiness = happiness;
this.energy = energy;
this.behavior = behavior;
}
getsTreat() {
this.happiness + 20;
}
takesNap() {
this.energy - 45;
this.behavior + 15;
}
}
var Charles = new Puppy(75, 25, 30);
Charles.getsTreat();
Charles.takesNap();