add solution#2303
Conversation
vladyslav-kukhar
commented
Jul 8, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it correctly implements all the required population calculations and DOM updates in src/scripts/main.js. You successfully read all .population spans via getElementsByClassName('population'), strip out commas, convert the values to numbers, and then compute both the total and the rounded average as specified [CHECKLIST ITEM #2, #3, #4, #5, #13]. The formatted results, with comma thousands separators, are then written back into the .total-population and .average-population spans, replacing the placeholder text exactly as required [CHECKLIST ITEM #6, #7, #8]. You also respected the constraints of the task by only changing main.js and not modifying any styles or HTML structure [CHECKLIST ITEM #9, #10, #11].
One minor, non-blocking improvement for future work would be to consider using Number.prototype.toLocaleString() instead of manual comma insertion, which can simplify formatting logic and improve readability. Another small refinement would be to extract the repeated formatting logic into a helper function to reduce duplication. Overall, your implementation is correct, satisfies the checklist, and demonstrates solid handling of DOM parsing and numeric calculations—nice work.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨