Add a solution - #2050
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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! ✨
No description provided.