Skip to content

add solution - #2052

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

add solution#2052
a-floreskul wants to merge 1 commit into
mate-academy:masterfrom
a-floreskul:develop

Conversation

@a-floreskul

Copy link
Copy Markdown
Steps to do this challenge:
  1. Find and get a list from the document.
  2. Create function sortList, which takes a list property, 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.
  3. Create function getEmployees, which takes a list property, and returns an array of right objects.
  4. Call both functions.
  5. Done.

You don't need to change styles or HTML layout in this task. Change only main.js file.

@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 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! ✨

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