Skip to content

solution - #3921

Open
rkhramiuk wants to merge 2 commits into
mate-academy:masterfrom
rkhramiuk:dev
Open

solution#3921
rkhramiuk wants to merge 2 commits into
mate-academy:masterfrom
rkhramiuk:dev

Conversation

@rkhramiuk

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

The implementation is very close, but there is a critical requirement that needs to be addressed before approval:

  • The hidden property should only exist on Herbivore instances (defaulting to false). Currently, hidden is set in the Animal constructor, so all animals—including carnivores—have this property. This violates the explicit checklist item: "The hidden property should be present and default to false for all Herbivore instances."

How to fix:

  • Move the initialization of this.hidden = false from the Animal constructor to the Herbivore constructor. This way, only herbivores will have the hidden property, 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/herbivoresAndCarnivores.js Outdated
constructor(name, health = 100) {
this.name = name;
this.health = health;
this.hidden = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 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

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! ✨

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