The property named .prototype
is a property of a constructor function only. It is stored elsewhere for an actual object instance and is not accessible as .prototype
there.
In modern browsers, you can use Object.getPrototypeOf(obj)
to get the prototype of an object instance. See MDN for details.
In some older browsers, you could get to it with obj.__proto__
.
There is no common reason to access the prototype itself on an object instance. It is meant to be the recipe by which new objects are created and THE place to access it is on the constructor as that controls how new objects are created. It is used internally by Javascript on an object instance so it is stored internally. If you're asking why a prototype-based language is designed that way, you're asking the wrong person - that's just how a prototype-based system is designed to be used.
You are meant to interact with the actual property values on an instance of an object, not with the prototype. The central place to access the prototype is via the constructor. There are some special cases of morphing an existing object instance by changing the prototype of an existing instance, but that is not a common design paradigm in prototype-based programming.
In C++ (which is not a prototype-based language, but shares some object oriented concepts), you change the class definition if you want to change how new objects of that type are created. You don't change one instance of a class and expect it to change how new objects of that type are created.