Skip to content

Commit db8d177

Browse files
authored
Merge pull request #1 from Grajales-K/main
London11 | Karla Grajales | sprint-3 mergin commits from main.
2 parents 8653109 + 86d7c97 commit db8d177

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

debugging/book-library/script.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ window.addEventListener("load", function (e) {
77

88
function populateStorage() {
99
if (myLibrary.length == 0) {
10-
let book1 = new Book("Robison Crusoe", "Daniel Defoe", "252", true);
10+
let book1 = new Book("Robinson Crusoe", "Daniel Defoe", "252", true);
1111
let book2 = new Book(
1212
"The Old Man and the Sea",
1313
"Ernest Hemingway",
@@ -37,8 +37,8 @@ function submit() {
3737
alert("Please fill all fields!");
3838
return false;
3939
} else {
40-
let book = new Book(title.value, title.value, pages.value, check.checked);
41-
library.push(book);
40+
let book = new Book(title.value, author.value, pages.value, check.checked);
41+
myLibrary.push(book);
4242
render();
4343
}
4444
}
@@ -54,7 +54,7 @@ function render() {
5454
let table = document.getElementById("display");
5555
let rowsNumber = table.rows.length;
5656
//delete old table
57-
for (let n = rowsNumber - 1; n > 0; n-- {
57+
for (let n = rowsNumber - 1; n > 0; n--) {
5858
table.deleteRow(n);
5959
}
6060
//insert updated row and cells

0 commit comments

Comments
 (0)