Skip to content

add task solution#1805

Open
Inna-code10 wants to merge 4 commits into
mate-academy:masterfrom
Inna-code10:develop
Open

add task solution#1805
Inna-code10 wants to merge 4 commits into
mate-academy:masterfrom
Inna-code10:develop

Conversation

@Inna-code10
Copy link
Copy Markdown

@Inna-code10 Inna-code10 commented Apr 24, 2026

Copy link
Copy Markdown

@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

The code defines the people array inline with hardcoded data instead of importing it from people.json. The task requires that main.js import the file using import { people } from './people.json';. This is a fundamental architectural requirement, and the solution must be updated to use the external JSON file rather than inline data.


✨ 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

Copy link
Copy Markdown

@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

The code logic in your JavaScript files is correct and meets all functional requirements for creating the table with proper calculations. However, there's a critical blocker preventing the application from running: main.js uses ES module import syntax (import { people } from './people.json';) but src/index.html loads it as a regular script without the type="module" attribute. This causes the browser to fail loading the script entirely.

To fix this, change line 26 in src/index.html from:

<script src="scripts/main.js"></script>

To:

<script type="module" src="scripts/main.js"></script>

This will allow the browser to properly handle the ES module syntax and load your data-driven table correctly.


✨ 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

Copy link
Copy Markdown

@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

The critical ES module issue has been successfully resolved - type="module" is now properly included on your script tag, and your code correctly handles all the required functionality: importing people data, calculating age and century, and generating table rows with all 6 cells. However, there's a test failure showing a TypeError: Cannot read properties of undefined (reading 'forEach') - this indicates your people.json data might not be loading correctly at runtime. This is a great learning opportunity to add defensive coding practices. Before calling .forEach() on your data, verify it exists and is an array: if (!peopleData || !Array.isArray(peopleData)) { console.error('Invalid data format'); return; }. Also double-check that your people.json file is valid JSON with no syntax errors (missing commas, trailing issues, etc.). The code structure looks solid - this is likely a data loading or JSON validity issue that you'll catch once the file is properly accessible to the browser. Keep going!


✨ 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

Copy link
Copy Markdown

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

good job

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.

3 participants