Skip to content

Commit 790c614

Browse files
committed
fix(read-status): show 'Yes' when checked and 'No' when unchecked
1 parent 1966aac commit 790c614

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

debugging/book-library/script.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,8 @@ function render() {
8888
changeBut.id = i;
8989
changeBut.className = "btn btn-success";
9090
wasReadCell.appendChild(changeBut);
91-
let readStatus = "";
92-
if (myLibrary[i].check == false) {
93-
readStatus = "Yes";
94-
} else {
95-
readStatus = "No";
96-
}
97-
changeBut.innerText = readStatus;
91+
92+
changeBut.textContent = myLibrary[i].check ? "Yes" : "No";
9893

9994
changeBut.addEventListener("click", function () {
10095
myLibrary[i].check = !myLibrary[i].check;

0 commit comments

Comments
 (0)