add solution - #2052
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation fully satisfies all task requirements. The parseSalary helper function correctly converts salary strings to numbers using regex, and both sortList and getEmployees functions are properly defined with the required list parameter. The sorting function correctly orders employees in descending order by salary and appends them back to the DOM, while getEmployees returns properly structured employee objects containing name, position, salary, and age fields. Your code adheres to all constraints, only modifying main.js without touching styles or HTML layout. Great work implementing this correctly!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Steps to do this challenge:
sortList, which takes alistproperty, and sorts list items in descending order by salary from data attribute. (Salary from data attribute is a string, do not forget to convert it to number, write helper function for it). Append sorted items to list.getEmployees, which takes alistproperty, and returns an array of right objects.You don't need to change styles or HTML layout in this task. Change only
main.jsfile.