In the previous chapter we learned how to use an object constructor:
As you can see in the above example, age property is attached to studObj1 instance. However, studObj2 instance will not have age property because it is defined only on studObj1 instance.
So what to do if we want to add new properties at later stage to a function which will be shared across all the instances?
Dateobjects inherit from
Arrayobjects inherit from
Personobjects inherit from
Object.prototype is on the top of the prototype inheritance chain:
Array objects, and
Person objects inherit from