Pankaj Singh
JS Crack

Follow

JS Crack

Follow
Prototype chaining in JavaScript

Photo by Karine Avetisyan on Unsplash

Prototype chaining in JavaScript

All the objects in JavaScript have a built-in property which is termed its prototype.

Pankaj Singh's photo
Pankaj Singh
·Jan 10, 2023·

1 min read

All the objects in JavaScript have a built-in property which is termed its prototype. The amazing thing here is that the prototype itself is an object so it has its own prototype, this phenomenon is termed prototype chaining or prototype chain. When a prototype has null for its own prototype then the prototype ends.

Prototype chaining in JavaScript

The above chain shows an object chaining of Employee Object Which has a prototype Person which has Object.prototype as prototype and Object.prototype has Null as a prototype so the chain ends there.

 
Share this