Prototype Chain — Inheritance Before class Existed
The relationship between __proto__, prototype, and Object.create()
proto vs prototype
__proto__ — internal link every object has. Points to the object's "parent." (Official: [[Prototype]])
prototype — property only functions have. Objects created with new Foo() get their __proto__ pointed at Foo.prototype.
class Is Syntactic Sugar
Whether you use class or function, the prototype chain is identical. class didn't create a new inheritance model — it wrapped the existing prototype chain for readability.
Property Lookup Order
obj.prop: obj itself → obj.proto → ... → null. If null reached, returns undefined.
Key Points
Every object references parent via __proto__ (=[[Prototype]])
new Foo() objects have __proto__ pointing to Foo.prototype
Property lookup: self → __proto__ → __proto__.__proto__ → null
class is syntactic sugar for prototype-based inheritance — same internals