-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Develop #3335
base: develop
Are you sure you want to change the base?
Develop #3335
Conversation
Feature/prettier
There was a problem hiding this 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 task requirements! 🎉 Your code is well-structured and effectively meets the core functionality needed. The use of splice
is a minor issue and doesn't impact the overall functionality, but switching to filter
would be a nice optimization for future improvements. Keep up the good work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
if (target.health <= 0) { | ||
const index = Animal.alive.findIndex((animal) => animal === target); | ||
|
||
Animal.alive.splice(index, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using splice
to remove the animal from Animal.alive
, consider using the filter
method to create a new array excluding animals with health less than or equal to 0. This approach is more efficient and aligns with the task checklist preference.
No description provided.