Glasgow | 25-ITP-SEP | Alaa Tagi | Sprint 2 | Book/Library#346
Glasgow | 25-ITP-SEP | Alaa Tagi | Sprint 2 | Book/Library#346Alaa-Tagi wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Can you check if any of this general feedback can help you further improve your code?
https://github.com/cjyuan/Module-Data-Flows/blob/book-library-feedback/debugging/book-library/feedback.md
Doing so can help me speed up the review process. Thanks.
|
i fixed HTML,JS and CSS files to match all requirements in this project. |
cjyuan
left a comment
There was a problem hiding this comment.
Code is greatly improved.
Input validation part can still use some improvement.
| if (Number.isNaN(pages) || pages <= 0) { | ||
| alert("Page count must be a positive number."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Some invalid "number of pages" can still pass the check on line 30.
| row.insertCell().textContent = book.title; | ||
| row.insertCell().textContent = book.author; | ||
| row.insertCell().textContent = book.pages; | ||
|
|
||
| changeBut.addEventListener("click", function () { | ||
| myLibrary[i].check = !myLibrary[i].check; | ||
| const readCell = row.insertCell(); |
There was a problem hiding this comment.
Can you think of the pros and cons of these two approaches for creating cells within a row?
- Keeping all the cell creation code in one location, like what the original code does.
- Scattering the cell creation code across different locations, like what you did.
There was a problem hiding this comment.
I think Keeping all cell creation code in one place make the structure easier to read and maintain, while scattering the code can make each part easier to manage but can also make the table setup less clear.
… and prevent any invalid book to be added
Learners, PR Template
Self checklist
Changelist
I have made some changes in script.js file to meet the rquirements.
Questions
No question.