add - #4486
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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! ✨
No description provided.