Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Object.getPrototypeOf()

Object.getPrototypeOf() 메서드는 지정된 객체의 프로토타입(가령 내부 [[Prototype]] 속성값)을 반환합니다.

구문

Object.getPrototypeOf(obj)

매개변수

obj
자신의 프로토타입이 반환되는 객체.

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

주의

ES5에서, obj 매개변수가 객체가 아닌 경우 TypeError 예외가 발생합니다. ES6에서, 매개변수는 Object로 강제됩니다.

Object.getPrototypeOf("foo");
// TypeError: "foo"는 객체가 아닙니다 (ES5 코드)
Object.getPrototypeOf("foo");
// String.prototype                  (ES6 코드)

스펙

스펙 상태 설명
ECMAScript 5.1 (ECMA-262)
The definition of 'Object.getPrototypeOf' in that specification.
Standard 초기 정의.
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Object.getProtoypeOf' in that specification.
Standard  
ECMAScript 2017 Draft (ECMA-262)
The definition of 'Object.getProtoypeOf' in that specification.
Draft  

브라우저 호환성

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 5 3.5 (1.9.1) 9 12.10 5
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? ? ?

Opera 전용 주의사항

이전 Opera 버전이 Object.getPrototypeOf()를 아직 지원하지 않지만, Opera는 Opera 10.50 이후로 비표준 __proto__ 속성을 지원합니다.

참조

문서 태그 및 공헌자

 이 페이지의 공헌자: Netaras
 최종 변경: Netaras,