Skip to content

add task solution#1992

Open
vitamartsekhovska wants to merge 2 commits into
mate-academy:masterfrom
vitamartsekhovska:develop
Open

add task solution#1992
vitamartsekhovska wants to merge 2 commits into
mate-academy:masterfrom
vitamartsekhovska:develop

Conversation

@vitamartsekhovska
Copy link
Copy Markdown

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

Your implementation has two critical issues that prevent task completion. First, the name property extraction uses worker.textContent.trim() which captures all text content within the <li> element, not just the employee name. Since position, salary, and age are retrieved from data attributes, the name should also come from worker.dataset.name for consistency and correctness. Second, the return value of getEmployees(mainList) is not being stored—you need to assign it to a variable like const employees = getEmployees(mainList) to actually use the extracted data. Both issues are functional blockers that must be fixed before approval.


✨ 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 on lines +24 to +27

return workerArray.map((worker) => {
return {
name: worker.textContent.trim(),
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 name property should come from a data attribute (worker.dataset.name) rather than textContent.trim(). Using textContent will capture all text within the <li> element, not just the employee's name.

Comment thread src/scripts/main.js Outdated
Comment on lines +37 to +38
sortList(mainList);
getEmployees(mainList);
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 return value of getEmployees is not being stored. Consider assigning it to a variable, e.g., const employees = getEmployees(mainList);

Copy link
Copy Markdown

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

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 approved. All task requirements are met: the sortList function correctly sorts employees by salary in descending order using childB - childA, the getEmployees function properly extracts and returns an array of employee objects with the correct schema {name, position, salary, age}, the salary values are converted to numbers using the helper function, and both functions are called with the main list element. The previous review issues have been resolved—the name property now correctly uses worker.dataset.name, and the return value of getEmployees() is properly stored. Great work!


✨ 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