Hello guys, i have a problem with this piece of code, in the conditionals, the code has to tell if you have s already read the book or not. what have i done wrong?
below is the full code
var books = [{title:"Digital-Minimalism",author:"Carl-Newport",alredyRead:false},
{title:"Outwitting-the-Devil",author:"Napolien-Hill",alredyRead:true},
{title:"Rich-dad-poor-Dad",author:"Robert-K",alredyRead:true}]
books.forEach((book) => if(book.alredyRead == true){
console.log(`You have already read ${book.title} by ${book.author}`)
}else{
console.log(`you still need to read ${book.title} by ${book.author}`);
}
)