Skip to content

Solution 1#1770

Open
YaroslavKra wants to merge 2 commits intomate-academy:masterfrom
YaroslavKra:develop
Open

Solution 1#1770
YaroslavKra wants to merge 2 commits intomate-academy:masterfrom
YaroslavKra:develop

Conversation

@YaroslavKra
Copy link

No description provided.

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

Good work on setting up the core logic for this task! The calculations for age and century are correct. However, this submission requires changes because two critical errors are preventing the script from running.

  1. In src/scripts/main.js, the people variable is declared twice: once as a large hard-coded array (lines 3-355) and again via an import. This causes a SyntaxError. Please remove the hard-coded array and rely on the imported JSON data.
  2. There's a typo in a variable name. You declared centuey on line 367, but then tried to use century in the template string. This results in a ReferenceError. Please correct the spelling in the declaration.

Once these two issues are fixed, your code should work as expected. Keep up the great effort!


✨ 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

console.log(people); // you can remove it

// write your code here
import people from './people.json';

Choose a reason for hiding this comment

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

The people variable is declared twice: once as a large hard-coded array at the top of this file (lines 3-355), and again with this import statement. This will cause a SyntaxError. According to the task instructions, you should use the data from people.json, so the hard-coded array should be removed.

<td>${person.born}</td>
<td>${person.died}</td>
<td>${age}</td>
<td>${century}</td>

Choose a reason for hiding this comment

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

This line will cause a ReferenceError because the variable century is not defined. It appears there's a typo in the variable declaration on line 367, where it's named centuey. Please ensure the variable names match.

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 pull request! I am approving your solution as you've successfully met all the task requirements. Your script correctly processes the JSON data, calculates the age and century, and dynamically populates the table as expected.

Please don't worry about the failed automated check. As noted in the analysis, this was due to an environment setup issue and is not a problem with your code. Your implementation is correct. Great job!


✨ 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