__proto__
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Warning: Changing the [[Prototype]] of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the obj.__proto__ = ... statement, but may extend to any code that has access to any object whose [[Prototype]] has been altered. You can read more in JavaScript engine fundamentals: optimizing prototypes.
Note: The use of __proto__ is controversial and discouraged. Its existence and exact behavior have only been standardized as a legacy feature to ensure web compatibility, while it presents several security issues and footguns. For better support, prefer Object.getPrototypeOf()/Reflect.getPrototypeOf() and Object.setPrototypeOf()/Reflect.setPrototypeOf() instead.
The __proto__ accessor property of Object instances exposes the [[Prototype]] (either an object or null) of this object.
The __proto__ property can also be used in an object literal definition to set the object [[Prototype]] on creation, as an alternative to Object.create(). See: object initializer / literal syntax. That syntax is standard and optimized for in implementations, and quite different from Object.prototype.__proto__.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
javascript.builtins.Object.proto Deprecated | 1 | 12 | 1 | 3 | 18 | 1 |
Syntax
// __proto__ example
// See MDN Web Docs for details Live demo
Inspect an object's prototype
Compare __proto__ with Object.getPrototypeOf on a plain object.
Create a simple inheritance chain
Link one object to another prototype and read inherited properties.
Use a null-prototype dictionary
Create a dictionary object without inherited Object.prototype members.
Use cases
-
Legacy debugging
Inspect old prototype-heavy code when modern Object APIs were not used consistently.
-
Migration work
Touch __proto__ only while replacing older patterns with safer, standard alternatives.
Cautions
- __proto__ is legacy behavior and can make object relationships harder to reason about than explicit APIs.
- Prototype mutation affects inheritance and performance in ways that are easy to misuse.
Accessibility
- No direct accessibility effect, but unstable object behavior can still surface as broken UI state.
- Prefer clearer object models that reduce maintenance risk in user-facing code.