Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job implementing the core logic! The population calculation and display are working perfectly.
However, this submission requires a change because a key project constraint was not met. The task instructions state that only the main.js file should be modified, but your submission includes changes to other files like .prettierrc, package.json, and package-lock.json.
Please revert the changes in all files except for src/scripts/main.js. Once you've done that, your solution will be ready for approval. You're very close!
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on the calculation logic! However, changes are needed because a couple of key requirements are not yet met.
First, files other than src/scripts/main.js have been modified. It is a strict requirement of the task to only submit changes within the main.js file. Please revert the changes in any other files.
Additionally, the average population is displayed with decimal places. The requirement is to match the numeric style of the original population figures, which are whole numbers. You can resolve this by rounding the average to the nearest integer using Math.round() before displaying it.
You're very close to a complete solution!
✨ 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
| document.getElementsByClassName('average-population')[0].textContent = ( | ||
| totalPopulation / population.length | ||
| ).toLocaleString(); |
There was a problem hiding this comment.
The average population calculation can result in a number with decimal places. According to the requirement to use the "same numeric style as populations presented" (which are whole numbers), you should round the average to the nearest integer. Consider using Math.round() before calling .toLocaleString().
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on the JavaScript logic! You've perfectly implemented the calculations for total and average population, and the formatting is spot-on. I am approving your solution as an educational exception so you can move forward. However, please be aware that changes were detected in files other than the required src/scripts/main.js, specifically in .github/workflows/test.yml-template, package-lock.json, and package.json. In future projects, it's crucial to only commit changes to the specified files to meet all requirements. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK