不錯,每函數對象,在默認情況下有一個.prototype
屬性,該屬性引用原型對象這個函數(如果用作構造成爲唯一重要的)。
默認情況下,每個prototype object
都有一個對constructor
函數的引用,當然這個函數指向構造函數(在您的示例中爲Test()
)。
所以,在這裏我們去
Test.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor
hmmm也是prototype.constructor.constructor.constructor。 - 作品,令人難以置信,仍試圖理解......謝謝 – Hello 2013-04-25 17:42:08
@你好,如果你仔細觀察'.prototype.constructor.constructor',你會注意到這引用了'Function()'的基本構造函數。記住,一個函數也是這個語言中的一個* object *。 – jAndy 2013-04-25 17:43:30