London | 25-ITP-Sep |Mariia Serhiienko | Sprint 2 | Book Library Project#368
Closed
Konvaly wants to merge 10 commits intoCodeYourFuture:mainfrom
Closed
London | 25-ITP-Sep |Mariia Serhiienko | Sprint 2 | Book Library Project#368Konvaly wants to merge 10 commits intoCodeYourFuture:mainfrom
Konvaly wants to merge 10 commits intoCodeYourFuture:mainfrom
Conversation
debugging/book-library/script.js
Outdated
Comment on lines
28
to
31
| const titleValue = title.value.trim(); | ||
| const authorValue = author.value.trim(); | ||
| const pagesValue = pages.value.trim(); | ||
| const pagesNumber = Number(pagesValue); |
There was a problem hiding this comment.
You don't need to add "value" to every variable because they usually hold values. Also, L30 and 31 can be merged.
debugging/book-library/script.js
Outdated
| return; | ||
| } | ||
|
|
||
| let book = new Book(titleValue, authorValue, pagesNumber, check.checked); |
debugging/book-library/script.js
Outdated
| authorCell.textContent = book.author; | ||
| pagesCell.textContent = book.pages; | ||
|
|
||
| const changeBut = document.createElement("button"); |
There was a problem hiding this comment.
Nothing you need to change but better name would be changeBtn, this is just a convention
Author
There was a problem hiding this comment.
Fixed changeBut to changeBtn and delBut to delBtn
Author
|
Thank you for your time and consideration @jennethydyrova ! |
|
Looks good to me! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
PR: Fix bugs and improve adding books
What was done:
Fixed errors that stopped books from showing on page load
Fixed issues when adding a new book
Corrected author and read status values
Fixed the delete button
Cleared the form after a book is added
Prevented adding the same book twice
Result: the app now works as expected and is easier to use when adding books.