Skip to content

Add a solution - #2050

Open
Slappy228 wants to merge 3 commits into
mate-academy:masterfrom
Slappy228:develop
Open

Add a solution#2050
Slappy228 wants to merge 3 commits into
mate-academy:masterfrom
Slappy228:develop

Conversation

@Slappy228

Copy link
Copy Markdown

No description provided.

@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

Two critical requirements are not met in your implementation. First, the name field uses item.textContent.trim() when it should use item.dataset.name to follow the data attributes requirement. Second, the salary in employee objects remains a string instead of being converted to a number, which violates the required employee object schema. Additionally, the task explicitly requires a helper function for salary string-to-number conversion that can be reused by getEmployees, but this function is missing. Please fix these issues: use dataset.name for the name field, implement a helper function to convert salary strings like "$1,850" to numbers, and apply it when building employee objects.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
Comment thread src/scripts/main.js Outdated

@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 is close to completion, but there's one critical issue that must be fixed. On line 24, the name field is extracted using item.textContent instead of item.dataset.name. The task specification explicitly requires 'Parse data from list using data attributes' and 'Use data attributes (dataset) to extract employee fields'. Interestingly, your position, salary, and age fields correctly use the dataset property — the name field should follow the exact same pattern. Please update line 24 to use item.dataset.name to be consistent with the other fields and meet the core requirement of parsing data from data attributes.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@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. All requirements are now correctly implemented: the getEmployees function properly extracts data using item.dataset.name (and other dataset properties), the sortList function sorts by salary in descending order using the salaryToNum helper, and both functions are called at the end of the file. Great work fixing that name field extraction issue — using item.dataset.name consistently across all fields shows solid understanding of the dataset API. The salary conversion with the + operator and comma removal is clean and efficient. Well done!


✨ 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