Skip to content

add task solution#2169

Open
nxqar wants to merge 3 commits intomate-academy:masterfrom
nxqar:develop
Open

add task solution#2169
nxqar wants to merge 3 commits intomate-academy:masterfrom
nxqar:develop

Conversation

@nxqar
Copy link

@nxqar nxqar commented Feb 3, 2026

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job implementing the core logic for calculating the total and average population! Your JavaScript code works correctly and meets most of the requirements.

However, this submission requires changes because a key constraint of the task was not met. The requirements state that only the src/scripts/main.js file should be changed, but your submission also includes modifications to src/styles/main.scss and src/styles/fonts.scss. Please revert the changes in these style files.

As a small tip for the future, your number formatting can be simplified by using the built-in number.toLocaleString('en-US') method. It's a more robust and standard approach than a custom function.

Once the unnecessary file modifications are removed, your solution will be ready for approval!


✨ 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 16 to 30
function commas(num) {
const str = num.toString();
let result = '';
let count = 0;

for (let i = str.length - 1; i >= 0; i--) {
if (count > 0 && count % 3 === 0) {
result = ',' + result;
}
result = str[i] + result;
count++;
}

return result;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job implementing the number formatting logic from scratch! For future reference, you can achieve the same result much more easily using the built-in toLocaleString() method. For example: num.toLocaleString('en-US'). This method is more robust and handles various formatting rules automatically.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your JavaScript implementation is excellent! The logic for calculating and formatting the population data is correct, and you've successfully addressed the functional requirements.

However, I am requesting a change because the submission includes modifications to src/styles/_fonts.scss. A core constraint of this task, which was also highlighted in the previous review, is that only the src/scripts/main.js file must be changed.

Please revert the changes in all other files. Once your submission only contains modifications to main.js, it will be ready for approval.


✨ 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 1 to 5
@font-face {
font-family: Roboto, Arial, Helvetica, sans-serif;
src: url('../fonts/Roboto-Regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
src: url('../fonts/Roboto-Regular-webfont.woff') format('woff');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the task requirements and the previous review feedback, you should not modify any style files. Please revert the changes in this file and ensure your submission only contains modifications to src/scripts/main.js.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this submission! I am approving your solution as it perfectly meets all the requirements. You've done a great job addressing the feedback from the previous review by correctly isolating your changes to the src/scripts/main.js file. The logic for calculating and formatting the total and average population is clean and correct. Well done!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants