Skip to content

solution#2011

Open
Tysiachnyk wants to merge 1 commit into
mate-academy:masterfrom
Tysiachnyk:develop
Open

solution#2011
Tysiachnyk wants to merge 1 commit into
mate-academy:masterfrom
Tysiachnyk:develop

Conversation

@Tysiachnyk

Copy link
Copy Markdown

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved because it correctly implements the required functionality and respects the key constraints. The sortList(list) function takes the ul element, collects its li children, sorts them by data-salary in descending order using a dedicated parseSalary helper, and re-appends the items, which matches the sorting requirements. The getEmployees(employeeList) function builds an array of objects with the required shape { name, position, salary, age }, pulling values from dataset and converting salary and age to numbers as specified. Both functions are called with the retrieved ul element, ensuring the behavior actually runs when the script loads.

One thing done well is the robust parseSalary helper, which can handle salary strings that include symbols/commas and avoids crashes by safely returning a number. As a minor improvement, you might consider whether returning 0 for invalid/missing salaries is what you want, or if you’d rather detect and handle such cases separately. Overall, your code is clear, functional, and aligned with the checklist requirements for this task. Great work on implementing the DOM parsing and sorting logic cleanly.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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