add total and average#2280
Conversation
Tendeeer
commented
Jun 14, 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 core JavaScript requirements for this task. Your code gathers all .population spans, strips commas, converts the values to numbers, and accurately computes both the total and the average, then updates .total-population and .average-population with toLocaleString() so the formatting matches the original data. This fulfills the key functional items like parsing, summing, averaging, and DOM replacement as described in the checklist.
One potential robustness improvement (not required for passing) would be to defensively handle any unexpected non-numeric or malformed .population content by skipping values that become NaN. Also, make sure outside of this file that you’ve updated the GitHub demo link with your username and are using npm run lint as requested, since those items cannot be checked from main.js alone. Overall, your implementation is clear, concise, and technically sound—well done on meeting the task’s main requirements.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨