Skip to content

add - #4486

Open
miabellaa wants to merge 1 commit into
mate-academy:masterfrom
miabellaa:develop
Open

add#4486
miabellaa wants to merge 1 commit into
mate-academy:masterfrom
miabellaa:develop

Conversation

@miabellaa

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your implementation correctly satisfies all task requirements. The Animal class properly initializes with health (default 100) and name properties. Herbivore correctly extends Animal with a hide method that sets hidden to true, and Carnivore extends Animal with a bite method that handles all edge cases correctly - exiting early if the target is a Carnivore or hidden, otherwise reducing health by 50. The health setter properly filters dead animals (health <= 0) from Animal.alive using Array.filter as required. Your code also correctly uses filter instead of indexOf + splice for removing animals, satisfying the performance checklist item.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants