๐ธprototype
๐ง under construction
JS โฉ value โฉ object โฉ prototype
desc
__proto__
is a getter/setter for [[Prototype]] and resides in Object.prototype.
is considered outdated, modern methods are:
to access
[[Prototype]]
(which is hidden and internal).
// โญ๏ธ `__proto__` is a getter & setter for [[Prototype]]
obj.__proto__ // call getter
obj.__proto__ = proto // call setter
Object.getPrototypeOf(obj)
Object.setPrototypeOf(obj, proto)
prototype chain can't go in circles.
Last updated
Was this helpful?