-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solution #1420
base: master
Are you sure you want to change the base?
solution #1420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's a small but important issue with the gender display logic in your code. Currently, the code is incorrectly labeling females as 'Male' and males as 'Female'. To fix this, you should update the condition to person.sex === 'f' ? 'Female' : 'Male'
. Once this is corrected, your solution will accurately represent the data. Keep up the great work, and don't hesitate to reach out if you need any help! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
src/scripts/main.js
Outdated
|
||
newRow.innerHTML = ` | ||
<td>${person.name}</td> | ||
<td>${person.sex === 'f' ? 'Male' : 'Female'}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a logic error in this line. The condition should be person.sex === 'f' ? 'Female' : 'Male'
to correctly display the gender. Currently, it is displaying 'Male' for females and 'Female' for males, which is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code has been reviewed and is approved! 🎉
You've successfully corrected the gender display logic, ensuring that males are labeled as 'Male' and females as 'Female', which aligns perfectly with the task requirements. The code now correctly iterates over the people
array, generates a table from the JSON data, calculates age and century, and appends the rows to the table with the class dashboard
.
While the code meets the task requirements and constraints, always remember to review any comments provided to further enhance your coding skills. If there are any critical issues, they should be addressed in future projects to avoid similar problems. Keep up the great work and continue learning from each experience! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
DEMO LINK