Conversation
24O07
commented
Feb 7, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work on this task! Your solution is approved as it correctly implements all the required functionality. The list sorting and employee data extraction work perfectly.
I have a couple of small suggestions to make your code even better:
- In your
getEmployeesfunction, you've duplicated the logic for converting the salary string to a number. To avoid this and make the code more maintainable, you can reuse thegetSalaryNumberhelper function you already created. - The
employeesArrayvariable is assigned a value but is never used. It's a good practice to remove unused variables to improve code readability.
These are just suggestions for improvement, not blockers. Keep up the excellent work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| return Array.from(list.children).map((item) => ({ | ||
| name: item.textContent.trim(), // ім'я з тексту li | ||
| position: item.dataset.position, | ||
| salary: Number(item.dataset.salary.replace(/[$,]/g, '')), |
There was a problem hiding this comment.
You've correctly converted the salary string to a number here. However, you have already created a helper function getSalaryNumber for this exact purpose. To avoid code duplication and make your code more maintainable, consider reusing your helper function here.
| if (employeeList) { | ||
| sortList(employeeList); // сортуємо список у DOM | ||
|
|
||
| const employeesArray = getEmployees(employeeList); // масив об'єктів |
There was a problem hiding this comment.
The employeesArray variable is assigned a value but is never used. It's good practice to remove unused variables to keep the code clean.