Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
TOP making a simple library app. Someone kind enough to tell me why it outputs "undefined"? thank you.
Post Body

let myLibrary=[ {
author:"Bill Bryson",
title:"A Walk In The Woods",
pages:205,
read:"not read yet"
},
{
author:"Jerome K Jerome",
title:"Three Men In A Boat",
pages:205,
read:"read"
}

];
function Book(author,title,pages,read){
this.author=author;
this.title=title;
this.read=read;
this.pages=pages;
}
//function to add new book to array
function addBookToLibrary(author,title,pages,read){
let book = new Book(author,title,pages,read)  
myLibrary.push(book);
}
//function to display books
const books = myLibrary
function displayBook(){
myLibrary.forEach((book)=>{
const list=document.querySelector('#book-list');
const row=document.createElement('tr');
row.innerHTML=`
    <td>${books.author}</td>
    <td>${books.title}</td>
    <td>${books.pages}</td>
    <td>${books.read}</td>
    <td><button>Delete</button></td>
    `
list.appendChild(row);
})
}
displayBook();

Author
User Disabled
Account Strength
0%
Disabled 1 year ago
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,819
Link Karma
451
Comment Karma
1,268
Profile updated: 8 hours ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago