Skip to content

dom_generate_table_task#1772

Open
TarasYelahin wants to merge 3 commits intomate-academy:masterfrom
TarasYelahin:develop
Open

dom_generate_table_task#1772
TarasYelahin wants to merge 3 commits intomate-academy:masterfrom
TarasYelahin:develop

Conversation

@TarasYelahin
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 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:

  1. The script fails with a TypeError because textContent is 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);.
  2. The 'Gender' column will not display correctly because the property in the data is sex, but the code is trying to access person.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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

values.forEach((v) => {
const td = document.createElement('td');

td.textContent(String(v));

Choose a reason for hiding this comment

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

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);.

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 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

const century = Math.ceil(person.died / 100);
const values = [
person.name,
person.gender,

Choose a reason for hiding this comment

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

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.

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 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! ✨

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