Skip to content

Commit 7b9abd2

Browse files
committed
add solution
1 parent 287d5dd commit 7b9abd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/herbivoresAndCarnivores.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class Herbivore extends Animal {
1919
class Carnivore extends Animal {
2020
bite(target) {
2121
if (target instanceof Herbivore && target.hidden === false) {
22-
target.hidden -= 50;
22+
target.health -= 50;
2323

24-
if (target.health <= 0) {
24+
if (target.health === 0) {
2525
Animal.alive = Animal.alive.filter((animal) => animal !== target);
2626
}
2727
}

0 commit comments

Comments
 (0)