Declare a function to extract the name of the book and the date borrowed by the user. The details of the book will be in the form of an array of objects.
-
If the user has borrowed the book,
return the name of the book
and
the date.
-
Each object will contain
the borrower
field.
-
Return a string
that looks like
"Borrower Name" borrowed "book name" on "date"
.
-
If the user has not borrowed any book,
return the string No books borrowed
.
For example: