Skip to content

Conversation

@24O07
Copy link

@24O07 24O07 commented Feb 7, 2026

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getEmployees function, 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 the getSalaryNumber helper function you already created.
  • The employeesArray variable 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

  1. Rate AI review example

return Array.from(list.children).map((item) => ({
name: item.textContent.trim(), // ім'я з тексту li
position: item.dataset.position,
salary: Number(item.dataset.salary.replace(/[$,]/g, '')),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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); // масив об'єктів

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The employeesArray variable is assigned a value but is never used. It's good practice to remove unused variables to keep the code clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants