Develop#2262
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The code has a critical typo that prevents the average population value from displaying correctly. On line 24, .avarage-population should be .average-population (note the 'a' vs 'e' spelling). While your calculation logic is correct and the total population display works properly, this typo means the average value will never appear in the intended span element. This is a blocker since the task specifically requires targeting average-population class. Please fix this spelling error and the implementation will be complete.
✨ 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
| document.querySelector('.total-population').textContent = | ||
| total.toLocaleString(); | ||
|
|
||
| document.querySelector('.avarage-population').textContent = |
There was a problem hiding this comment.
The task requires targeting span with class average-population, but the code queries .avarage-population (typo: 'avarage' vs 'average'). This will cause the average value to not be displayed in the correct element. Change '.avarage-population' to '.average-population'.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
On line 22, the class selector .aveditrage-population is misspelled. The average calculation is correct, but the value will never appear in the intended <span> element because the selector doesn't match the HTML. Change 'aveditrage' to 'average' so the selector becomes .average-population. This is required for checklist items #5 and #13.
✨ 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
| document.querySelector('.total-population').textContent = | ||
| total.toLocaleString(); | ||
|
|
||
| document.querySelector('.aveditrage-population').textContent = |
There was a problem hiding this comment.
Typo in class name - should be .average-population not .aveditrage-population. This prevents the calculated average from displaying in the correct element.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved and fully meets all task requirements. The previous issue with the misspelled class selector ".aveditrage-population" has been successfully fixed to ".average-population", allowing your calculated values to populate the correct HTML elements. Your implementation correctly parses population data from the span elements, converts strings to numbers, calculates both total and average populations, and formats the output with thousands separators using ".toLocaleString()". Great job catching and fixing that typo - these kinds of attention-to-detail issues are common and your fix shows solid debugging skills. Keep up the excellent work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Replace
<your_account>with your Github username in the link- DEMO LINK
2. Follow this instructions
- There are no tests for this task so use
npm run lintcommand instead ofnpm test