[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf [Back]  [Original]

Object.getPrototypeOf() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Object.getPrototypeOf()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

Object.getPrototypeOf() ( , [[Prototype]]) .

In this article

Object.getPrototypeOf(obj)

obj

, .

js
var proto = {};
var obj = Object.create(proto);
Object.getPrototypeOf(obj) === proto; // true
js
> Object.getPrototypeOf('foo')
TypeError: "foo" is not an object  //  ES5
> Object.getPrototypeOf('foo')
String.prototype                   //  ES6

ES5, obj , TypeError. ES6, Object.

js
> Object.getPrototypeOf('foo')
TypeError: "foo" is not an object  //  ES5
> Object.getPrototypeOf('foo')
String.prototype                   //  ES6

Specification
ECMAScript 2027 LanguageSpecification
# sec-object.getprototypeof

Opera

Opera Object.getPrototypeOf(), Opera Object.prototype.__proto__, Opera 10.50.


Web Proxy Viewer  |  New URL  |  Original Page