solution - #2074
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I’m requesting changes because one core requirement isn’t met: the salary in the employee objects is still a string rather than a number. The task requires converting the salary to a number using the provided helper, and returning numeric salary from getEmployees.
Critical issues to fix:
- In
src/scripts/main.js, insidegetEmployees(likely around the mapping ofliitems), replaceitem.dataset.salarywithhelperParseSalary(item.dataset.salary)sosalaryis a number as required.
Minor improvement:
- When parsing
age, preferNumber(item.dataset.age)orparseInt(item.dataset.age, 10)to be explicit.
Your sorting logic using helperParseSalary and overall structure look good. Once the salary conversion in getEmployees is fixed, this should meet all requirements.
✨ 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
I am approving this submission. The implementation correctly parses data-salary using helperParseSalary, sorts the list in descending salary order, and builds the employees array with the required fields (name, position, salary, age). Both sortList and getEmployees are implemented and invoked, fulfilling the core requirements without any functional gaps. As a minor improvement, you could use Number(item.dataset.age) instead of parseInt for consistency with numeric parsing. If needed for tests or external usage, consider exporting or assigning the result of getEmployees, but this is not a blocker. Nice work addressing the previous issue and ensuring numeric comparisons are used for sorting.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK