🔸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.
IteratorPrototype - prototype of all built-in iterators.
all objects created by object literal have the same prototype - Object.prototype.
used in object's prototypal inheritance.
function's prototype is used as new 's [[Prototype]].
super ===
[[HomeObject]].[[Prototype]]⭐️[[Prototype]] is also cloned by clone(obj).
"pure" object is an object without [[Prototype]] (=== null).
Last updated
Was this helpful?