Skip to content

add task solution#2155

Open
pivkota wants to merge 1 commit intomate-academy:masterfrom
pivkota:develop
Open

add task solution#2155
pivkota wants to merge 1 commit intomate-academy:masterfrom
pivkota:develop

Conversation

@pivkota
Copy link

@pivkota pivkota commented Jan 20, 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

I am approving your solution. Great job implementing the logic to parse the data and calculate the total and average populations! The core functionality is working perfectly. One small suggestion for improvement is to round the average population to a whole number before displaying it. This will make it visually consistent with the other population figures on the page, which are all integers. You can easily achieve this using Math.round(). Keep up the great work!


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

Footnotes

  1. Rate AI review example

const average = numbers.length ? total / numbers.length : 0;

const formattedTotal = total.toLocaleString();
const formattedAverage = average.toLocaleString();

Choose a reason for hiding this comment

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

The average calculation will likely result in a number with decimal places. Using toLocaleString() directly on it will preserve these decimals. To match the integer-only style of the population numbers in the list, consider rounding the average to the nearest whole number before formatting it.

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