Conversation
Kit3AWP
commented
Apr 7, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on implementing the core logic to fetch the data and perform the calculations! Your code is clean and works well.
There is one small adjustment needed to meet the task's styling requirements. The calculated average population is currently being displayed with decimal places, but the task requires it to have the 'same numeric style as populations presented,' which are all whole numbers.
To fix this, please round the average value to the nearest whole number before you format it using toLocaleString(). The Math.round() function would be a great choice for this. After that small change, your solution will be perfect!
✨ 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
| }, 0); | ||
| const average = total / populationNumbers.length; | ||
| const totalFormatted = total.toLocaleString(); | ||
| const averageFormatted = average.toLocaleString(); |
There was a problem hiding this comment.
The task requires the calculated numbers to have the 'same numeric style as populations presented'. The presented populations are whole numbers. When you calculate the average, it's likely to be a floating-point number (e.g., 12345.67). Using toLocaleString() directly on this will result in a formatted string with decimals (e.g., "12,345.67"), which doesn't match the style of the other population figures.
Consider rounding the average to the nearest whole number before formatting it. Math.round() would be a good function to use for this.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work addressing the feedback from the previous review! Rounding the average population was the final piece needed, and now the output perfectly matches the required numeric style. The code is clean, functional, and all task requirements are fully met. I'm happy to approve your solution. Great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨