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

solution #975

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

solution #975

wants to merge 1 commit into from

Conversation

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

Great job on implementing the functionality to dynamically add and remove rows and columns in the table! 🎉 Your code meets the task requirements and constraints effectively. Just a friendly reminder to ensure that the table always has at least one row and one column to prevent any potential runtime errors when accessing table.rows[0].cells.length. Keep up the great work and happy coding! 😊

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


function isDisabled() {
const rowCount = table.rows.length;
const colCount = table.rows[0].cells.length;

Choose a reason for hiding this comment

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

Ensure that the table has at least one row and one column initially. Accessing table.rows[0].cells.length without checking if table.rows has any rows can lead to a runtime error if the table is empty.

});

appendColumn.addEventListener('click', () => {
if (table.rows[0].cells.length < 10) {

Choose a reason for hiding this comment

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

Similar to the previous comment, ensure that table.rows has at least one row before accessing table.rows[0].cells.length to prevent potential runtime errors.

});

removeColumn.addEventListener('click', () => {
if (table.rows[0].cells.length > 2) {

Choose a reason for hiding this comment

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

Before accessing table.rows[0].cells.length, ensure that table.rows is not empty to avoid runtime errors.

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