What is the prototype chain in JavaScript?

Understand how JavaScript inheritance works using the prototype chain and __proto__ references.

intermediateIntermediate conceptsjavascriptprototypesinheritance
Published: 11/3/2025
Updated: 11/3/2025

Question

What is the prototype chain in JavaScript?


Answer

In JavaScript, inheritance happens through the prototype chain — every object has an internal [[Prototype]] link (accessible as __proto__).

When you access a property, JavaScript checks:

  1. The object itself
  2. Its prototype
  3. The prototype’s prototype
    ... until it reaches Object.prototype
const parent = { greet: () => console.log('Hi!') };
const child = Object.create(parent);
child.greet(); // "Hi!"

If not found in the chain, it returns undefined.

Real-World Example

All arrays inherit from Array.prototype, which inherits from Object.prototype.

Quick Practice

Create two objects linked via prototype and access a property from the parent.

Summary

The prototype chain is JavaScript’s inheritance backbone — flexible, dynamic, and powerful.

Related Videos
Watch these videos to learn more about this topic
Frequently Asked Questions

Do arrow functions have prototypes?

No, only traditional functions have prototype properties.


Stay Updated

Get the latest frontend challenges, interview questions and tutorials delivered to your inbox.