If I have book
object with following structure
{title: string, author: string, genre: string, read: boolean}
and I have the req.body
that has all the fields from book
object as well as few others.
Is there a way to refactor following code to more concise?
book.title = req.body.title
book.author = req.body.author
book.genre = req.body.genre
book.read = req.body.read