Instance proto Points to Constructor.prototype
What you'll learn: How an instance's __proto__ property links directly to its constructor function's prototype object.
The Essential Connection
When you create an instance using a constructor function with the new keyword, JavaScript establishes a fundamental relationship: the instance's __proto__ property (its internal prototype link) points to the constructor function's prototype object.
This is the bridge that makes inheritance work. It's how instances gain access to shared methods and properties defined on the constructor's prototype.
The Link in Action
function Animal(name) {
this.name = name;
}
Animal.prototype.speak = function() {
console.log(`${this.name} makes a sound`);
};
const dog = new Animal('Buddy');
// The critical connection:
console.log(dog.__proto__ === Animal.prototype); // true
When you call new Animal('Buddy'), JavaScript automatically sets dog.__proto__ to reference Animal.prototype. This is why dog can call speak() — it finds it by following the __proto__ link.
Verifying the Connection
console.log(Object.getPrototypeOf(dog) === Animal.prototype); // true
console.log(dog.__proto__ === Animal.prototype); // true
// The dog instance can access methods on Animal.prototype
dog.speak(); // "Buddy makes a sound"
Both __proto__ and Object.getPrototypeOf() reveal the same connection: they point to the constructor's prototype object.
Why This Matters
This connection is what makes the prototype chain work. When you access a property on an instance, JavaScript first checks the instance itself, then follows __proto__ to check the constructor's prototype, continuing up the chain until it finds the property or reaches null.
Key Takeaway: An instance's __proto__ always points to its constructor function's prototype object — this automatic link enables inheritance and shared methods across all instances.