add solution - #2071
add solution#2071lubovmrk wants to merge 2 commits into
Conversation
lubovmrk
commented
Sep 9, 2026
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
This requires changes because core task requirements are not met, which will block automated checks. Specifically: 1) The required function name must be sortList, but it’s implemented as sortEmployeesBySalary (see src/scripts/main.js around line 3). 2) Both functions must accept a list parameter (sortList(list) and getEmployees(list)), but they currently query the DOM internally (lines ~3 and ~13), violating the explicit requirement. 3) The task asks for a standalone helper for salary string-to-number conversion; currently getSalary is nested and the conversion logic is duplicated (lines ~6 and ~18).
How to fix:
- Rename
sortEmployeesBySalarytosortListand update any calls accordingly. - Change function signatures to accept a
listparameter and use that instead of querying the DOM; call them assortList(list)andgetEmployees(list). - Extract a single reusable helper (e.g.,
parseSalary(str)) and use it in both functions to avoid duplication.
The core sorting logic and schema handling look good; once these naming/parameter/helper requirements are aligned, this should pass. Keep going—you're close!
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all task requirements. The sortList function correctly sorts employees by salary in descending order, the getEmployees function returns the mapped employee array, and both functions properly accept the list parameter as specified. The parseSalary helper is well-implemented as a standalone function that converts salary strings to numbers. The code follows the required schema with employee objects containing name, position, salary, and age properties. All functional checklist items pass, and the demo link correctly includes your GitHub username. Great work on addressing all previous review feedback!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨