32. Customizing Constructors - is there a mistake?


#1

Is it necessary to end function Book with ";"?

Anyway, thank's for the course!


#2

If you define the Book function as a so-called named-Function
like

function Book() { }

you will not use an ending-semi-colon-;.

But if you define the Book =function= using a so-called anonymous function via a variable
like

var Book = function() { };

you will use an ending-semi-colon-;
as it is an End-of-Statement indicator,
and the statement being the variable definition.

Reference:
= http://stackoverflow.com/questions/336859/var-functionname-function-vs-function-functionname?rq=1


#3

Aside:

We won't use Book as a variable name if convention is to apply, unless Book is a custom object constructor. Just saying.