Conversation
GabrielSpelchuk
commented
Feb 17, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work on implementing the core logic to parse the data and calculate the total and average population! The calculations themselves are correct.
However, this requires a change because a key requirement from the task description has been missed. The final calculated numbers for both the total and average population must be formatted with a thousands separator to match the style of the original data (e.g., 4,367,332,219 instead of 4367332219).
You might find the number.toLocaleString() method useful for this. Please apply this formatting to your results before setting the textContent of the elements.
✨ 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
src/scripts/main.js
Outdated
| const totalPopulationElement = document.querySelector('span.total-population'); | ||
| const avgPopulationElement = document.querySelector('span.average-population'); | ||
|
|
||
| totalPopulationElement.textContent = totalPopulation; |
There was a problem hiding this comment.
The task requires the final number to be formatted with a thousands separator (e.g., '1,234,567'). Currently, the raw number is being assigned. You might find the toLocaleString() method helpful for number formatting.
src/scripts/main.js
Outdated
| const avgPopulationElement = document.querySelector('span.average-population'); | ||
|
|
||
| totalPopulationElement.textContent = totalPopulation; | ||
| avgPopulationElement.textContent = Math.round(averagePopulation); |
There was a problem hiding this comment.
Just like the total population, the average population also needs to be formatted with a thousands separator. Make sure to apply the formatting after rounding the value.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work! I am approving this pull request. You've successfully addressed the feedback from the previous review by adding the thousands separator formatting using toLocaleString. The code now correctly meets all the requirements of the task. Great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨