For this exercise you will write a constructor for making "book" objects. This object should have the following properties: title
, author
, the number of pages
, and whether or not you have read
the book.
Put a function into the constructor that can report the book info like so
book.info() // "The Hobbit by J.R.R. Tolkien, 295 pages, not read yet"
Important Note: It is better to return
things rather than putting console.log()
directly into the function. In this case, return the info
string and log it after the function has been called:
console.log(theHobbit.info());
Push your solution, create the pull request and submit its URL.