Methods shared via prototypes which needs construction only once.
Overridden methods from parent class available to be called
Clear inheritance chain available from instanceof
initialization of the myChildClass prototype is not deferred in this most common use of
prototype based inheritance. This required that the parent class be instantiated while the
page was loading but before the
DIV used to contain messages was fully
Initialization of prototype from a parent class can lead to dependencies in the child class on the arguments used to construct the parent class instance used as a prototype. For example, an immediate property in the parent class becomes a prototype property in the child class.
As you can see in the example, the
name property of
myChildClass was prototyped to the value defined in the call to create the
myParentClass used as myChildClass's prototype.
Initialization of inherited immediate properties is adhoc.