Repository navigation
first commit - #2102
first commit#2102DaniilDanilyuk wants to merge 2 commits into
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has a critical sorting order issue that needs to be fixed. The task explicitly requires sorting in descending order (highest salary first), but your comparator uses intoValue(a.getAttribute('data-salary')) - intoValue(b.getAttribute('data-salary')) which produces ascending order. While using prepend instead of append happens to display the correct visual result, the sort comparator itself must produce descending order as specified in the requirements. Change the comparator to intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')) to fix this issue.
✨ 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
| arrOfElement.sort( | ||
| (a, b) => | ||
| intoValue(a.getAttribute('data-salary')) - | ||
| intoValue(b.getAttribute('data-salary')), |
There was a problem hiding this comment.
The sort comparator produces ascending order (a - b), but the task requires descending order. Change to intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')) to sort from highest to lowest salary.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. The implementation correctly addresses all task requirements: the sorting comparator now properly produces descending order (highest salary first) using intoValue(b.getAttribute('data-salary')) - intoValue(a.getAttribute('data-salary')), all required functions are implemented (sortList and getEmployees), the helper function intoValue for salary conversion is in place, and both functions are called as specified. All checklist items pass, including proper use of data attributes, correct employee object schema, and appropriate DOM manipulation.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.