London | 26-ITP-Jan | Angela McLeary | Sprint 2 | Book Library#415
London | 26-ITP-Jan | Angela McLeary | Sprint 2 | Book Library#415AngelaMcLeary wants to merge 39 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/CodeYourFuture/Module-Data-Flows/blob/general-review-feedback/debugging/book-library/feedback.md
Doing so can help me speed up the review process. Thanks.
debugging/book-library/script.js
Outdated
| let readStatus = ""; | ||
| if (myLibrary[i].check == false) { | ||
| readStatus = "Yes"; | ||
| } else { | ||
| readStatus = "No"; | ||
| } else { | ||
| readStatus = "Yes"; | ||
| } | ||
| changeBut.innerText = readStatus; | ||
| changeBtn.innerText = readStatus; |
There was a problem hiding this comment.
This could be a good opportunity to practice using the ? : conditional operator. Can you rewrite the code on lines 88–94 as a single statement?
There was a problem hiding this comment.
Hi @cjyuan, Thank you for your feedback. Good suggestion — I’ve replaced the if statement with a ternary operator for a cleaner single-line expression.
| this.pages = Number(pages); | ||
| this.check = check; | ||
| } | ||
| function alertDeleteToast(message) { |
There was a problem hiding this comment.
Hi @cjyuan, I replaced alert() with a toast notification to avoid blocking execution. The toast displays feedback after the delete operation completes and supports styled, multi-line messages for better readability and user experience.
Learners, PR Template
Self checklist
Changelist
Debugging of book library app and fixing typos, syntaxes and validation to mention a few.