Skip to content

fix: methodSort#2508

Open
eg3844540-svg wants to merge 2 commits intomate-academy:masterfrom
eg3844540-svg:master
Open

fix: methodSort#2508
eg3844540-svg wants to merge 2 commits intomate-academy:masterfrom
eg3844540-svg:master

Conversation

@eg3844540-svg
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/arrayMethodSort.js
function applyCustomSort() {
[].__proto__.sort2 = function(compareFunction) {
// write code here
Array.prototype.sort2 = function (compareFunction) {
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 scaffold specifies [].__proto__.sort2 but Array.prototype.sort2 is used. While functionally equivalent, consider using the exact scaffold syntax for consistency.

Copy link
Copy Markdown

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

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

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