Skip to content

add solution#1750

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

add solution#1750
GabrielSpelchuk wants to merge 1 commit intomate-academy:masterfrom
GabrielSpelchuk:develop

Conversation

@GabrielSpelchuk
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.

Review Summary

I am approving your solution because it correctly fulfills the core requirements: you create one table row per person, generate six cells with the right fields, compute age as died - born, compute century with Math.ceil(person.died / 100), and append each row to the .dashboard table. Functionally, this will work as expected in the given environment and does not contain any critical blockers.

Critical behavior is correct, but there are a couple of small improvements you could make next time: in src/scripts/main.js, add a guard after const table = document.querySelector('.dashboard'); (e.g., if (!table) return;) so the script won’t throw if the table is missing in another DOM setup, and rename the loop variable from persone to person for clarity and readability. These issues are non-blocking style/robustness points, not functional errors. Overall, solid work implementing the required table logic and calculations—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


// write your code here

const table = document.querySelector('.dashboard');

Choose a reason for hiding this comment

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

Consider guarding the table lookup so the code fails gracefully if the element is missing. Right now table.appendChild(tr) will throw if document.querySelector('.dashboard') returns null. Example: if (!table) return; or throw a clear error. This improves robustness when DOM fixture is different.


const table = document.querySelector('.dashboard');

people.forEach((persone) => {

Choose a reason for hiding this comment

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

The loop variable persone looks like a typo. Rename it to person for clarity (people.forEach((person) => { ... })). This does not change functionality but improves readability.

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