Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
인스턴스의 프로토타입을 만든 Object 함수의 참조를 반환합니다. 이 속성값은 함수 자체의 참조임을 주의하세요, 함수 이름을 포함하는 문자열이 아니라. 그 값은 1, true 및 "test"와 같은 원시(primitive) 값에 대해서만 읽기 전용입니다.
모든 객체는 자신의 prototype으로부터 constructor 속성을 상속합니다:
다음 예는 프로토타입이 Tree인 그 형의 객체 theTree를 만듭니다. 그 다음 객체 theTree의 constructor를 표시합니다.
이 예는 다음 출력을 표시합니다:
다음 예는 일반 객체의 constructor 값을 수정하는 법을 보입니다. true, 1 및 "test"만이 원래 읽기 전용 생성자를 갖기에 영향을 받지 않습니다. 이 예는 객체의 constructor 속성에 의존하는 게 항상 안전하지는 않음을 보입니다.
이 예는 다음 출력을 표시합니다:
| ECMAScript® 2027 Language Specification # sec-object.prototype.constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023년 8월 8일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.