Prototypal Inheritance in JavaScript
When I started learning JavaScript, one sentence kept popping up everywhere: “JavaScript uses prototypal inheritance.” At first, it sounded intimidating. But once I understood how property lookup…
Swarup Das
On this page
When I started learning JavaScript, one sentence kept popping up everywhere:
“JavaScript uses prototypal inheritance.”
At first, it sounded intimidating. But once I understood how property lookup actually works, everything became much clearer.
This blog explains prototypal inheritance from the ground up, using simple examples, and real intuition.
🧠 What Is Prototypal Inheritance?
Prototypal inheritance in JavaScript is a mechanism where objects inherit properties and methods from other objects.
Unlike classical languages (Java, C++), JavaScript does not copy properties from parent to child.
Instead, it delegates property access through a chain of objects.
This is why prototypal inheritance is better described as delegation, not traditional inheritance.
🔍 The Hidden [[Prototype]]
Every JavaScript object has a hidden internal property called:
[[Prototype]]
This property points to another object, known as the object’s prototype.
You can access it using:
Object.getPrototypeOf(obj);
// or (not recommended for production)
obj.__proto__;
🔗 How Property Lookup Works (Prototype Chain)
When you try to access a property:
obj.someProperty

Leave a Comment