Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solution #1561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add solution #1561

wants to merge 1 commit into from

Conversation

SokolAlena
Copy link

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.

Your code does a great job of meeting the task requirements and constraints! 🎉 It correctly processes population data and updates the HTML elements as needed. There are a couple of minor issues, such as a typo in the reduce method's callback parameter and a commented-out line with an incorrect method call. These don't impact the core functionality, but addressing them will make your code even better. Keep up the great work and happy coding! 😊

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

@@ -1,3 +1,34 @@
'use strict';

// write your code here
const populations = [...document.querySelectorAll('span.population')];
// const onePopulation = document.queryElementById

Choose a reason for hiding this comment

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

This line is commented out and seems to contain a typo in the method name. It should be document.getElementById instead of document.queryElementById if you intend to use it.

};

const total = mappedPopulation.reduce(
(accumulator, curentValue) => accumulator + curentValue,

Choose a reason for hiding this comment

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

There is a typo in the parameter name curentValue. It should be currentValue to correctly represent the current value in the reduce method.

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