The error contradicts the instructions


#1



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


when i click "Save and Submit" the Red Brick of Death says
"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."
when the instructions say that the pages property goes into the constructor first, am i doing something wrong?


// 3 lines required to make harry_potter
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. Tolkein");

but according to how you're supposed to create the "Book" constructor, pages is plugged in first, then author


#2

Hi your author name should be

"J.R.R. Tolkien"

and you wrote

"J.R.R. Tolkein"

#3

facepalm thanks.....why is it always tiny mistakes like this? WHY?


#4

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