Conversation
NiaAnastasia
commented
Feb 6, 2026
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work on the JavaScript logic! The code to calculate and display the population data is clean and functions perfectly. However, changes are needed because the task had a strict requirement to only modify the src/scripts/main.js file. Your submission also included changes to style files (src/styles/main.scss and src/styles/_fonts.scss), which violates this constraint. Please revert the changes in all other files and resubmit. I'm ready to approve it once that single correction is made.
✨ 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
This reverts commit c7ae391.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work addressing the previous feedback! The core logic for calculating the total and average is implemented correctly. I am requesting one final change to address a missed requirement before approving.
The task requires you to 'Make sure that the given string can be converted to a number' before performing calculations. Your current code converts the string directly, but it doesn't validate it first. If any of the span elements contained non-numeric text (e.g., 'N/A'), your calculations would result in NaN.
To make your solution more robust, please add a step to filter out any non-numeric values before you sum them. A check using !isNaN() would be a great way to handle this. Keep up the great work!
✨ 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 populationNumbers = populationSpans.map((el) => { | ||
| return Number(el.textContent.replaceAll(',', '')); | ||
| }); |
There was a problem hiding this comment.
The task requires you to 'Make sure that the given string can be converted to a number'. Your current code converts the string but doesn't validate it first. If any of the span elements contained text that couldn't be converted to a number (e.g., 'N/A'), Number() would produce NaN, and your final total and average would also be NaN. It would be more robust to filter out any non-numeric values before calculating the sum.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work! I am approving your solution. You've successfully addressed the feedback from the previous review by adding the filter step to ensure only valid numbers are used in the calculation. Your code is now more robust and meets all the task requirements perfectly. This is a fantastic implementation, great job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨