Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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 variableliholds the<ul>element. A more descriptive name likeemployeeListwould better reflect its contents. - The
getEmployeesfunction 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
|
|
||
| // write code here | ||
| const listElement = document.querySelector('ul'); | ||
| const li = listElement; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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);.
No description provided.