Error message when creating the_hobbit with the Book constructor


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.


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.


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