London|ITP-Jan-2026 |Alexandru Pocovnicu | Sprint 2 | Book library - #410
London|ITP-Jan-2026 |Alexandru Pocovnicu | Sprint 2 | Book library #410alexandru-pocovnicu wants to merge 30 commits into
Conversation
…ality in render function
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…space in script.js
…n and update button text handling
…tion checks in submit function
cjyuan
left a comment
There was a problem hiding this comment.
Changes look good. Just a few more suggestions.
| let readStatus = ""; | ||
| if (myLibrary[i].check == false) { | ||
| readStatus = "Yes"; | ||
| } else { | ||
| readStatus = "No"; | ||
| } else { | ||
| readStatus = "Yes"; | ||
| } | ||
| changeBut.innerText = readStatus; | ||
| changeButton.textContent = 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 84–90 as a single statement?
…o the top for better organization
| changeBut.innerText = readStatus; | ||
|
|
||
| changeBut.addEventListener("click", function () { | ||
| myLibrary[i].check == false ? (readStatus = "No") : (readStatus = "Yes"); |
There was a problem hiding this comment.
expr1 ? expr2 : expr3 is an expression that evalutes to the value of either expr2 or expr3 depending
on the truthy value of expr1.
Normal use of ? : is
variable = expr1 ? expr2 : expr3;
instead of
expr1 ? (variable = expr2) : (variable = expr3);
Note: .check is a boolean value. You can just use its value directly without comparing it to true or false.
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
debugged the code