The __proto__ property
JavaScript objects have an internal [[prototype]] property that references the object's prototype, that is, the object it inherits: the prototypal inheritance model, which JavaScript uses. To read the property, we had to use Object.getPrototypeof() and to create a new object with a given prototype, we had to use the Object.create() method. A [[prototype]] property cannot be directly read or be modified.
Inheriting was cumbersome due to the nature of the [[prototype]] property; therefore, some browsers added a special __proto__ property in objects, which is an accessor property that exposes the internal [[prototype]] property and makes working with prototypes easier. The __proto__ property was not standardized in ES5, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access