Prototypal Inheritance in Function Objects
This lesson teaches us the concept of prototypal inheritance in function objects as well as property shadowing.
We'll cover the following...
We'll cover the following...
Prototypal inheritance from Object
How does prototypal inheritance/prototype chaining work when constructor functions are used to create objects?
All properties (including methods) added to the prototype of the constructor function could be shared by the object instances created from it.
Every constructor function initialized has a prototype property assigned to it known as the Prototype Object. It contains the properties constructor and __proto__ that sets the object’s [[Prototype]] property. Its [[Prototype]] is set to null. All object instances created will have their [[Prototype]] reference the prototype object. The images below depict this:
As ...