Skip to content

Sort and parse employee list - #2059

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

Sort and parse employee list#2059
ArtMay777 wants to merge 1 commit into
mate-academy:masterfrom
ArtMay777:develop

Conversation

@ArtMay777

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

I am approving your solution. The implementation meets the task requirements: both functions are correctly implemented and invoked, and getSalary properly handles string-to-number conversion. While there’s a minor consistency suggestion—inside getEmployees you may currently read item.dataset.salary as a string; consider using getSalary(item.dataset.salary) when building each employee object to ensure salary is always a number—this is not a blocker. Everything appears clean, follows the expected schema, and should function correctly. Nice work tightening up the helper usage and keeping the code clear and maintainable.


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

Footnotes

  1. Rate AI review example

Comment thread src/scripts/main.js
Comment on lines +19 to +25
function getEmployees(employeesList) {
return [...employeesList.children].map((item) => ({
name: item.textContent.trim(),
position: item.dataset.position,
salary: item.dataset.salary,
age: item.dataset.age,
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The getEmployees function returns salary as a string (from item.dataset.salary). Consider converting it to a number using the getSalary helper function for consistency with how salary is typically represented in employee data objects.

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