Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #3421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

maksym-kostetskyi
Copy link

No description provided.

Copy link

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

Choose a reason for hiding this comment

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

Great job on implementing the classes! 🎉 Your code meets all the task requirements and constraints. The current approach to filtering the Animal.alive array is perfectly fine, though you might consider simplifying it in the future. Keep up the excellent work! 😊

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

Comment on lines +27 to +28
if (animal.health <= 0) {
Animal.alive = Animal.alive.filter((a) => a !== animal);

Choose a reason for hiding this comment

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

The current implementation checks the animal's health before filtering the Animal.alive array, which is a good practice. However, according to the task requirements, it's also acceptable to filter the array directly without this check. You can keep this implementation as it is, or simplify it by directly using the filter method.

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