Skip to content

add task solution#1905

Open
Natalia2408-forever wants to merge 1 commit intomate-academy:masterfrom
Natalia2408-forever:develop
Open

add task solution#1905
Natalia2408-forever wants to merge 1 commit intomate-academy:masterfrom
Natalia2408-forever:develop

Conversation

@Natalia2408-forever
Copy link

No description provided.

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 work on this task! Your solution is clean, functional, and meets all the requirements for sorting the list and parsing the employee data. I am approving your submission.

For future reference, here are a couple of minor suggestions to make your code even more readable and robust:

  • In src/scripts/main.js, the variable li holds the <ul> element. A more descriptive name like employeeList would better reflect its contents.
  • The getEmployees function returns an array of employees, but the result isn't captured. It's a good practice to assign this to a variable (e.g., const employees = getEmployees(listElement);) to make use of the data.

These are just best-practice suggestions, and your code works perfectly as is. Keep up the 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


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

Choose a reason for hiding this comment

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

The variable name li is a bit misleading here, as it holds the entire <ul> element, not a single <li> element. To improve readability, consider using a more descriptive name like employeeList or simply passing listElement directly to the functions.


sortList(li);

getEmployees(li);

Choose a reason for hiding this comment

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

The getEmployees function is called, but its return value (the array of employee objects) is not captured or used. The task requires you to "Get an array of employees", which implies that the resulting array should be stored. Consider assigning it to a variable, for example: const employees = getEmployees(li);.

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