Skip to content

add task solution#1795

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

add task solution#1795
JordanKoby wants to merge 3 commits intomate-academy:masterfrom
JordanKoby:develop

Conversation

@JordanKoby
Copy link
Copy Markdown

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

Great work on implementing the core logic for this task! The age and century calculations are correct, and you've successfully populated the table from the data.

However, a small change is needed to meet the requirements. In src/scripts/main.js, the 'gender' column's output needs to match the task's 'Expected result' image, which shows 'm' and 'f'. Your code currently displays a more readable version. Please adjust it to use the value from the person.sex property directly.

Once that's updated, this will be ready for approval!


✨ 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

Comment thread src/scripts/main.js

const sexCell = document.createElement('td');

sexCell.textContent = person.sex === 'm' ? 'Male' : 'Female';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While it's a good idea to make the gender display more readable, the task's 'Expected result' image shows 'm' and 'f'. Please use the value from the person.sex property directly to match the requirements.

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

Excellent work on this pull request! Your code in main.js correctly implements all the requirements, and the table generation is perfect. I am approving your solution. You may notice a failing check, but this is an environment issue related to project dependencies and not a fault in your code. If you encounter this in the future, regenerating the package-lock.json file by deleting it and running npm install usually resolves it. Well done!


✨ 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

Your solution is approved because the core functionality in src/scripts/main.js is correct: you iterate over the people array, create a table row with six cells (name, gender, born, died, age, century), and correctly compute age as died - born and century as Math.ceil(died / 100). Since there are a couple of issues, this is an educational override to help you progress while learning. The main compliance issue is that README.md was modified even though the task explicitly asked to change only src/scripts/main.js ([CHECKLIST ITEM #7]); to fix this in a real submission, you’d revert README.md back to its original state. In src/scripts/main.js, where you use const table = document.querySelector('.dashboard'); and then append rows, you should add a guard like if (!table) return; (or a clear error) before table.appendChild(row); so the code doesn’t throw if the table is missing ([CHECKLIST ITEM #4] and [CHECKLIST ITEM #5]). As a minor improvement, you could collect all created rows in a DocumentFragment and append that once to the table for slightly better performance, and consider handling unexpected sex values more explicitly instead of assuming only two options. Overall, your logic is solid and readable, and with these small compliance and robustness tweaks you’d have a very polished solution.


✨ 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