function updateReadStatus(event) {
  let bookNode = event.target.parentNode.parentNode;
  let keyTitle = bookNode.querySelector("h3");

  let targetIndex = myLibrary.findIndex(
    (book) => book.title === keyTitle.textContent
  );
  myLibrary[targetIndex].read = event.target.checked;

  localStorage.setItem("myLibrary", JSON.stringify(myLibrary));
  displayStatistics();
}
//function that checks for changes in read status of added books and updates it accordingly
function that checks for changes in read status of added books and updates it accordingly
function that checks for changes in read status of added books and updates it accordingly
function updateReadStatus(event) {
  let bookNode = event.target.parentNode.parentNode;
  let keyTitle = bookNode.querySelector("h3");
  let targetIndex = myLibrary.findIndex(
    (book) => book.title === keyTitle.textContent
  );
  myLibrary[targetIndex].read = event.target.checked;
  localStorage.setItem("myLibrary", JSON.stringify(myLibrary));
  displayStatistics();
}
function updateReadStatus ( event ) { let bookNode = event . target . parentNode . parentNode ; let keyTitle = bookNode . querySelector ( "h3" ) ; let targetIndex = myLibrary . findIndex ( ( book ) => book . title === keyTitle . textContent ) ; myLibrary [ targetIndex ] . read = event . target . checked ; localStorage . setItem ( "myLibrary" , JSON . stringify ( myLibrary ) ) ; displayStatistics ( ) ; }
function that checks for changes in read status of added books and updates it accordingly
function that checks for changes in read status of added books and updates it accordingly