함수와 prototype프로퍼티 관계 도식도

CODEDRAGON Development/JavaScript, jQuery, ...

반응형


 

 

함수와 prototype프로퍼티 관계 도식도

·       함수가 생성될 함수 자신과 연결된 프로토타입 객체를 동시에 생성하며 서로 참조하게 됩니다.

·       이는 프로토타입과 프로토타입 체이닝의 이해를 위한 기본 개념이 됩니다.

 


 

 

 

 

prototype프로퍼티 vs [[Prototype]]프로퍼티

구분

설명

prototype프로퍼티

함수 객체가 가지는 prototype프로퍼티는 해당 함수가 생성자로 사용될 함수를 통해 생성된 객체의 부모 역할을 하는 프로토타입 객체를 가리킵니다.

[[Prototype]]프로퍼티

모든 객체에 있는 내부 프로퍼티인  [[Prototype]]프로퍼티는 객체 입장에서 자신의 부모 역할을 하는 프로토타입 객체를 가리킵니다.

 

 

 






함수의 프로퍼티 명세

ECMAScript 명세서-15.3.3  Properties of the Function Constructor 발췌


 

 

 

[[Prototype]]내부 프로퍼티 명세

ECMAScript 명세서-8.6.2  Object Internal Properties and Method 발췌


 

 

Object.prototype객체 명세

ECMAScript 명세서-15.2.4  Properties of the Object Prototype Object

 

 

 

Function.prototype객체 명세

ECMAScript 명세서-15.3.4  Properties of the Function Prototype Object

 


반응형