solution - #3921
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation is very close, but there is a critical requirement that needs to be addressed before approval:
- The
hiddenproperty should only exist onHerbivoreinstances (defaulting tofalse). Currently,hiddenis set in theAnimalconstructor, so all animals—including carnivores—have this property. This violates the explicit checklist item: "Thehiddenproperty should be present and default tofalsefor allHerbivoreinstances."
How to fix:
- Move the initialization of
this.hidden = falsefrom theAnimalconstructor to theHerbivoreconstructor. This way, only herbivores will have thehiddenproperty, as required.
Everything else in your code looks great! Once you make this change, your implementation will fully meet the requirements. Keep up the good work—you're almost there!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| constructor(name, health = 100) { | ||
| this.name = name; | ||
| this.health = health; | ||
| this.hidden = false; |
There was a problem hiding this comment.
The hidden property is being set on all Animal instances, but according to the requirements, only Herbivore instances should have the hidden property (defaulting to false).
This violates checklist item: "The hidden property should be present and default to false for all Herbivore instances."
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
All core requirements for the herbivores and carnivores system are fully met. Your implementation correctly uses ES6 classes, manages the hidden property only for herbivores, and ensures the bite and hide methods behave exactly as specified. The static Animal.alive array is managed properly, and all technical and functional constraints are satisfied. Great job addressing previous feedback and delivering a robust, clear solution! Keep up the excellent work.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.