Skip to content
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

task solution #1416

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

task solution #1416

wants to merge 2 commits into from

Conversation

OwlDevcUA
Copy link

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.

Great job on implementing the script to dynamically create a table and calculate the age and century of death! 🎉 While there are a couple of minor improvements suggested, such as removing redundant code and ensuring rows are appended correctly, these do not critically impact the functionality. Keep up the good work and consider these suggestions for future enhancements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines 359 to 360
people.forEach((person, index) => {
const row = table.insertRow(index);

Choose a reason for hiding this comment

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

Inserting a row at the index of the loop iteration might not work as expected if the table already contains rows. Consider using table.insertRow(-1) to always append the new row at the end of the table.

cell5.innerHTML = person.died - person.born;
cell6.innerHTML = Math.ceil(person.died / 100);

table.appendChild(row);

Choose a reason for hiding this comment

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

Appending the row to the table is redundant since insertRow already adds the row to the table. You can remove this line.

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