Table of contents
- 1. Summary
- 2. Syntax
- 3. Parameters
- 4. Description
- 5. Cross-browser compatibility
- 6. See also
Introduced in JavaScript 1.8.1
Summary
Returns the prototype of the specified object.
Method of Object | |
|---|---|
| Implemented in | JavaScript 1.8.1 |
| ECMAScript Edition | ECMAScript 5th Edition |
Syntax
Object.getPrototypeOf(object)
Parameters
- object
- The object whose prototype is to be returned.
Description
Throws a TypeError exception if the object parameter isn't an Object.
Cross-browser compatibility
Based on Kangax's compat table.
| Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 3.5 | 5 | 9 | -- | 5 |
| Feature | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |
Even if Opera does not support Object.getPrototypeOf() yet, it does support the non-standard __proto__ property since Opera 10.50.
See also
- isPrototypeOf
- John Resig's post on getPrototypeOf