kindly help me, i have been having this error Cannot read property ‘title’ of undefined, and i got stuck
bookRouter.route("/:id")
.get((req,res)=>{
const {id} = req.params.id
res.render("bookView",
{
nav: [{ link:"/books", title:"Books" },
// eslint-disable-next-line no-dupe-keys
{ link:"/authors", title:"Authors"
}
],
title: "Books center",
book: books[id]
}
)
});
<div class="row">
<br>
<div class="col-md-2 col-sm-3 text-center">
<a class="story-title" href="#"><img alt="" src="http://api.randomuser.me/portraits/thumb/men/58.jpg" style="width:100px;height:100px" class="img-circle"></a>
</div>
<div class="col-md-10 col-sm-9">
<h3><%=book.title%></h3>
<div class="row">
<div class="col-xs-9">
<h4><span class="label label-default"><%=books.author%></span></h4><h4>
<small style="font-family:courier,'new courier';" class="text-muted">2 hours ago • <a href="/books/<%=i%>" class="text-muted">Read More</a></small>
</h4></div>
<div class="col-xs-3"></div>
</div>
<br><br>
</div>
</div>