London | 26-ITP-January | Mouawia Elkhalifa | Sprint 2 | Book Library#414
London | 26-ITP-January | Mouawia Elkhalifa | Sprint 2 | Book Library#414MouawiaElkhalifa wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
3635d7d to
23e1f66
Compare
This comment has been minimized.
This comment has been minimized.
23e1f66 to
cfd4ac1
Compare
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.
|
Refactored the script to ensure proper data types, improved variable naming, and resolved the accessibility issues |
| @@ -1,47 +1,23 @@ | |||
| let myLibrary = []; | |||
There was a problem hiding this comment.
Could consider declaring myLibrary using const, since it is not going to be reassigned another value.
| const pagesValue = parseInt(pagesInput.value); | ||
|
|
||
| if (!titleValue || !authorValue || isNaN(pagesValue)) { | ||
| alert("Please fill all fields with valid information!"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
What range of whole numbers are considered valid?
| deleteBtn.addEventListener("click", () => { | ||
| myLibrary.splice(index, 1); | ||
| render(); | ||
| setTimeout(() => alert(`Deleted: ${book.title}`), 100); |
There was a problem hiding this comment.
Nice touch to prevent the alert dialog box from blocking the UI update.
|
Note: In the PR description, the checkboxes and the "Changelist" header are not yet properly encoded in Markdown syntax. |
Learners, PR Template
Self checklist
[x] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
[x] My changes meet the requirements of the task
[x] I have tested my changes
[x] My changes follow the style guide
Changelist
In this PR, I have completed the Book Library debugging exercise.