Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .reviewrelatedfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/**/*
6 changes: 6 additions & 0 deletions checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1. Implement only `Array.prototype.sort2`. Do NOT override `Array.prototype.sort`.
2. Keep the given scaffold: define `sort2` via `[].__proto__.sort2 = function(compareFunction) { ... }` inside `applyCustomSort` in `src/arrayMethodSort.js`.
3. `sort2` must sort the array in place and return the original array (same reference, not a copy).
4. When `compareFunction` is not provided, compare elements as strings (their default string representation, by character codes). Example: `[3, 12, 2, 11].sort2()` must return `[11, 12, 2, 3]`.
5. When `compareFunction` is provided, use its return value to order elements: negative → first before second, positive → first after second.
6. Do NOT call the built-in `Array.prototype.sort` in your implementation. Write your own sorting algorithm (bubble sort, insertion sort, etc.).
Loading