Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Good work on setting up the logic for this task. The calculations for age and century are correct, and the overall structure is solid. However, a couple of changes are needed because the script currently crashes and won't display the table.
There are two critical issues to fix:
- The script fails with a
TypeErrorbecausetextContentis a property, not a method. You need to assign the value to it instead of calling it like a function. For example:td.textContent = String(v);. - The 'Gender' column will not display correctly because the property in the data is
sex, but the code is trying to accessperson.gender.
Once these two issues are addressed, your solution will be perfect. 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
src/scripts/main.js
Outdated
| values.forEach((v) => { | ||
| const td = document.createElement('td'); | ||
|
|
||
| td.textContent(String(v)); |
There was a problem hiding this comment.
textContent is a property, not a method. You should assign the value to it instead of calling it as a function. For example: td.textContent = String(v);.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work fixing the TypeError! The script now runs perfectly without crashing. However, this requires one more change before it can be approved. The 'Gender' column in the table is currently empty or showing undefined.
This is happening because the code in src/scripts/main.js is trying to access person.gender, but the data object uses the property sex. Please update this property name to correctly populate the table. You are very close to a complete solution!
✨ 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
src/scripts/main.js
Outdated
| const century = Math.ceil(person.died / 100); | ||
| const values = [ | ||
| person.name, | ||
| person.gender, |
There was a problem hiding this comment.
The data object for each person uses the property sex to store the gender, not gender. This will cause the 'Gender' column in the table to be empty or show undefined.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this revision! You've successfully addressed the feedback from the previous review by correctly using person.sex to populate the 'Gender' column. Your script now perfectly handles all requirements, including the calculations for age and century. The code is clean, efficient, and well-structured. I am happy to approve this submission!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.