javascript

How Prototype Works in JavaScript

A prototype in JavaScript is an object with a special role: it’s the parent of another object. And the role of a parent is to provide properties to its children. Let’s see how a prototype is linked to another object. Internal Property [[Prototype]] Every object has an internal property named [[Prototype]]. The value of [[Prototype]] is either a reference to another object or null. Example: Observations: a has no prototype.