Inheriting Properties from Two Level Prototype Objects
This section provides a quick description of how constructor's prototype objects form a two-level inheritance. A tutorial example is provided to show object property inheritance from first and send level prototype objects.
Now we know how an object inherits properties from its constructor's prototype object.
Since the constructor's prototype object can also inherit properties from its own constructor's prototype object, an object can inherit properties from its own prototype object and the prototype's prototype object.
To show you this two-level inheritance feature, I wrote this tutorial example below to allow "myBook" inherit properties from the "price" property from the first level prototype and the "copyright" property from the second level prototype:
The diagram below shows you how properties from prototype objects of two levels
are inherited by the object.
Table of Contents