fix: methodSort#2508
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation correctly fulfills all functional requirements—it properly implements sort2 without overriding the built-in sort, uses a custom bubble sort algorithm, sorts in place, and passes all test cases. However, there's a blocking lint error on line 7: the no-extend-native rule prohibits extending Array.prototype, which prevents the build from passing. While the task requires adding sort2 to the Array prototype (as noted in the scaffold), the linter configuration conflicts with this requirement. You'll need to either configure ESLint to allow this specific extension or consult with your instructor about the intended approach for handling this rule.
✨ 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
| function applyCustomSort() { | ||
| [].__proto__.sort2 = function(compareFunction) { | ||
| // write code here | ||
| Array.prototype.sort2 = function (compareFunction) { |
There was a problem hiding this comment.
The scaffold specifies [].__proto__.sort2 but Array.prototype.sort2 is used. While functionally equivalent, consider using the exact scaffold syntax for consistency.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution correctly implements all requirements for the Array.prototype.sort2 method. The no-extend-native lint error has been resolved with the appropriate ESLint disable comment, and the bubble sort implementation properly sorts arrays in place, handles default string comparison correctly, and supports custom compare functions. All tests pass and no critical issues remain.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.