Every JavaScript object has an internal slot called [[Prototype]]. This slot either points to another object (its prototype) or is null. When you access a property on an object and it isn't found as an own property, JavaScript walks up the chain of [[Prototype]] links until it finds the property or reaches null.
This is the prototype chain — the core mechanism behind inheritance in JavaScript. Unlike classical OOP where classes are blueprints stamped out at instantiation, JavaScript objects delegate behaviour to other live objects.
const dog = { name: "Rex", bark() { return "Woof!"; } };
// Every object's chain ends at Object.prototype → null
Object.getPrototypeOf(dog) === Object.prototype; // true
Object.getPrototypeOf(Object.prototype); // null
// Property lookup order: own → prototype chain → null
dog.toString(); // inherited from Object.prototype__proto__ is a legacy accessor that exposes [[Prototype]]. Avoid it in production code — use Object.getPrototypeOf(obj) instead.When you write class Animal , JavaScript creates a constructor function and sets up prototypes for you. The class keyword is purely syntactic sugar — there are no classes at runtime. Understanding prototypes means you understand exactly what every class, extends, and super call does under the hood.