Error message when creating the_hobbit with the Book constructor


#1


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

The Book constructor is as follows:

 function Book (pages, author) {...}

But when I create the_hobbit using this (misspelled) line:

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

It displays this message:

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

That first should be second.


#2

A very old 'non-blocking' issue that we can be fairly certain will never get fixed, but hopefully won't be missed in any new iteration of the course.

Just to fool around,

function Book (author,pages) {

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

gave this SCT message:

Please do not modify the Book constructor!

No matter. At least not all users will encounter this as it does allow a pass when the spelling is correct.


#3

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