Skip to content
uencoder

Prototype Chain

The prototype chain is JavaScript's object inheritance mechanism: objects look up properties along the __proto__ chain, up to null.

Purpose

Understand JS object inheritance and property lookup, and use prototypes correctly.

Mechanism

Reading a property walks the prototype chain: obj → obj.__proto__ → ... → Object.prototype → null. Writing creates the property on the object itself. Object.create/assign and class syntax manipulate the prototype chain.

Use cases

  • JavaScript objects
  • Inheritance mechanism
  • Prototype methods

Related terms

Related tutorials

References