Relation between [[Prototype]] and prototype in JavaScript
- by Claudiu
From http://www.jibbering.com/faq/faq_notes/closures.html :
Note: ECMAScript defines an internal [[prototype]] property of the internal Object type. This property is not directly accessible with scripts, but it is the chain of objects referred to with the internal [[prototype]] property that is used in property accessor resolution; the object's prototype chain. A public prototype property exists to allow the assignment, definition and manipulation of prototypes in association with the internal [[prototype]] property. The details of the relationship between to two are described in ECMA 262 (3rd edition) and are beyond the scope of this discussion.
What are the details of the relationship between the two? I've browsed through ECMA 262 and all I've read there is stuff like:
The constructor’s associated prototype can be referenced by the program expression constructor.prototype,
Native ECMAScript objects have an internal property called [[Prototype]]. The value of this property is either null or an object and is used for implementing inheritance.
Every built-in function and every built-in constructor has the Function prototype object, which is the initial value of the expression Function.prototype
Every built-in prototype object has the Object prototype object, which is the initial value of the expression
Object.prototype (15.3.2.1), as the value of its internal [[Prototype]] property, except the Object
prototype object itself.
From this all I gather is that the [[Prototype]] property is equivalent to the prototype property for pretty much any object. Am I mistaken?