Skip to content

ITP-Jan| NW | Jovy So | Module-Data-Flows | Book-library #222

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

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

Conversation

jovyso
Copy link

@jovyso jovyso commented Apr 23, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

According to https://validator.w3.org/, there are errors in your index.html. Can you fix these errors?

The code in script.js can also use some improvement.

}
render();
Copy link
Contributor

Choose a reason for hiding this comment

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

If we call render() here, do we still need calling render() at line 5?

Comment on lines -57 to 56
for (let n = rowsNumber - 1; n > 0; n-- {
for (let n = rowsNumber - 1; n > 0; n--) {
table.deleteRow(n);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of deleting the table rows one by one, can you think of a more efficient way to remove all rows (except the <th>...</th>) in the table?

Copy link
Contributor

Choose a reason for hiding this comment

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

In terms of input validation (lines 30-36),

  1. Are all input properly checked?
  2. Can .value be null? (Do we need to check someInputElement.value == null?)
  3. Do you want to allow book title and author name to contain only space characters? For example, " ".
  4. What if a user enters an invalid page number in the "pages" input field?
  • Lines 70, 87:

    • Are the values assigned to these id attributes unique?
    • Is there any need to assign an id attribute to either buttons?
  • Line 65:

    • The current method of assigning book titles to HTML elements can cause display issues if a title contains special character sequences like <i>.
  • Can you suggest a more consistent naming convention for the variables representing the two buttons, currently named changeBut and delButton?

  • Line 74-79: Can you use the conditional operator, ? : to simplify these statements into one line of code?

@cjyuan cjyuan added the Reviewed Volunteer to add when completing a review label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants