Error message incorrect and wont accept my correct code


#1



https://www.codecademy.com/en/courses/spencer-sandbox/5/3?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again. Make sure that the_hobbit's author is J.R.R. Tolkien by passing it as the first argument to the Book constructor.

The error message does not add up with the way the premade function is defined as, and wont accept my code (which it should).


var harry_potter = new Object();
harry_potter.pages = 350;
harry_potter.author = "J.K. Rowling";

// A custom constructor for book
function Book (pages, author) {
    this.pages = pages;
    this.author = author;
}

// Use our new constructor to make the_hobbit in one line

var the_hobbit = new Book(320, "J.R.R Tolkien");


#2

@ra1ph,
The instructions::
Use this constructor to make the_hobbit, a book with 320 pages by "J.R.R. Tolkien".

The Oops-message Make sure that the_hobbit's author is J.R.R. Tolkien

Now have a close look at your

"J.R.R Tolkien"


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.