Skip to content

Conversation

@Nika-Andriy
Copy link

@Nika-Andriy Nika-Andriy commented Jan 22, 2026

Copy link

@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

Great job on implementing the core functionality! The sorting logic works correctly and the employee data is parsed into the required object structure.

However, this requires a couple of changes to fully align with the task requirements. The sortList and getEmployees functions should accept the <ul> list element as a single argument, not an array of <li> items. You can then derive the list of items from the element inside the function, for example, by using Array.from(list.children).

Also, there's a small typo in a helper function name: parceSalary should be parseSalary. Please make these adjustments, and you'll be all set!


✨ 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

const listOfEmployeesFromHtml = document.querySelector('ul');
const employeesFromHtml = Array.from(document.querySelectorAll('li'));

function parceSalary(salary) {

Choose a reason for hiding this comment

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

There's a small typo in the function name. It should be parseSalary.

return parseFloat(salary.replace(/[$,]/g, ''));
}

function sortList(listElement, items) {

Choose a reason for hiding this comment

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

This function works, but its signature could be improved. The requirement states it should take a list property. You could pass just the listElement and then get the items from it inside the function (e.g., Array.from(listElement.children)). This would make the function more self-contained and reusable.

});
}

function getEmployees(items) {

Choose a reason for hiding this comment

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

According to the task requirements, this function should take a list property (the <ul> element) as an argument, not an array of list items. You should get the list items from the passed list element inside this function.

Copy link

@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

Excellent progress! I am approving your solution because you've successfully refactored the sortList and getEmployees functions to accept the <ul> element, which was the main requirement. The code now works as expected. There is just one minor typo remaining in the parceSalary function name, which should be parseSalary. While this doesn't break functionality, correcting it is important for code quality and was a point from the previous review. Please fix this small detail, but otherwise, great job!


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

Footnotes

  1. Rate AI review example

// write code here
const listOfEmployeesFromHtml = document.querySelector('ul');

function parceSalary(salary) {

Choose a reason for hiding this comment

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

There's a small typo in the function name here. Based on the previous review feedback, it should be parseSalary.

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