Skip to content

added solution#1281

Open
Demtar23 wants to merge 1 commit intomate-academy:masterfrom
Demtar23:develop
Open

added solution#1281
Demtar23 wants to merge 1 commit intomate-academy:masterfrom
Demtar23:develop

Conversation

@Demtar23
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 this task! Your solution correctly implements all the required functionality for the growth table, including adding/removing rows and columns and properly disabling the buttons at the boundaries. I am approving your submission because it successfully meets all the project requirements.

I have one small suggestion for future improvement. In your removeRow event listener, the condition table.tBodies[0].rows.length <= 2 works perfectly. However, for better precision and consistency with your removeColumn handler, you could use a strict equality check: table.tBodies[0].rows.length === 2. This is a minor point in an otherwise excellent implementation. Keep up the great work!


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

Footnotes

  1. Rate AI review example

Comment thread src/scripts/main.js
table.tBodies[0].deleteRow(-1);
}

if (table.tBodies[0].rows.length <= 2) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This condition works correctly. However, since your logic on line 31 prevents the number of rows from ever going below 2, a more precise check would be table.tBodies[0].rows.length === 2. This would also make the logic consistent with the removeColumn handler, which uses a strict equality check on line 69.

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