Our volunteers haven't translated this article into Tiếng Việt yet. Join us and help get the job done!
You can also read the article in English (US).

The Object.getPrototypeOf() method returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.




The object whose prototype is to be returned.

Return value

The prototype of the given object. If there are no inherited properties, null is returned.


var proto = {};
var obj = Object.create(proto);
Object.getPrototypeOf(obj) === proto; // true


In ES5, it will throw a TypeError exception if the obj parameter isn't an object. In ES2015, the parameter will be coerced to an Object.

// TypeError: "foo" is not an object (ES5 code)
// String.prototype                  (ES2015 code)


Specification Status Comment
ECMAScript 5.1 (ECMA-262)
The definition of 'Object.getPrototypeOf' in that specification.
Standard Initial definition.
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Object.getPrototypeOf' in that specification.
ECMAScript Latest Draft (ECMA-262)
The definition of 'Object.getPrototypeOf' in that specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
getPrototypeOfChrome Full support 5Edge Full support 12Firefox Full support 3.5IE Full support 9Opera Full support 12.1Safari Full support 5WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes


Full support  
Full support

Opera-specific notes

Even though older Opera versions don't support Object.getPrototypeOf() yet, Opera supports the non-standard __proto__ property since Opera 10.50.

See also

Document Tags and Contributors

Cập nhật lần cuối bởi: mdnwebdocs-bot,