What is the Prototype Chain in JavaScript
Inheritance in JavaScript is called prototypal inheritance. When you try to access a property of an object, the property will not only be looked for in the object but on the prototype of the object, on the prototype of the prototype and this goes on until a matching property is found or we reach the end of the prototype chain. The same thing goes for methods.
In JavaScript, everything is inherited from Object
.
Resources:
Rocket Launch Your Career
Speed up your learning progress with our mentorship program. Join as a mentee to unlock the full potential of Webtips and get a personalized learning experience by experts to master the following frontend technologies: