Library Project Help

Hi everyone,

I made a rough outline of the library project. It is able to show the inputs as a table, but I am not sure how to append this data to the array. Here is the jsfiddle code:

Thank you for your help in advance.


You are pushing the book data to the myLibrary array inside of your addBookToLibrary() function, but you only call addBookToLibrary once.

If you add an event listener to the submit button, you will push the book data into the myLibrary array every time you submit a new book.

Try this: submitBtn.addEventListener(“click”, () => addBookToLibrary())

It’s also worth putting a console log inside your addBookToLibrary() function so you can see what’s happening as you go.

Like this: console.log(‘myLibrary’, myLibrary);