Conversation
pavloPolyvoda-dev
commented
Mar 6, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on this task! Your solution meets all the requirements: the list is correctly sorted by salary, and the employee data is parsed perfectly. I'm approving your work.
I noticed a small opportunity for improvement in src/scripts/main.js. The logic to parse the salary is repeated inside the getEmployees function. To keep your code DRY (Don't Repeat Yourself), you can reuse the parseSalary helper function you already created:
const salary = parseSalary(employee);This is a minor point about code quality and doesn't affect the functionality. 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((employee) => { | ||
| const nameEmp = employee.textContent.trim(); | ||
| const position = employee.dataset.position; | ||
| const salary = Number(employee.dataset.salary.replace(/[^0-9.-]+/g, '')); |
There was a problem hiding this comment.
This line duplicates the logic from the parseSalary helper function. To avoid repetition and keep your code DRY (Don't Repeat Yourself), you can reuse the helper function here:
const salary = parseSalary(employee);