可能重複:
What it the significance of the Javascript constructor property?什麼時候需要在Javascript中設置類的'prototype.constructor'屬性?
在JavaScript docs在developer.mozilla.org,繼承的話題有一個例子
// inherit Person
Student.prototype = new Person();
// correct the constructor pointer because it points to Person
Student.prototype.constructor = Student;
我不知道爲什麼要我在這裏更新原型的構造函數屬性?
'var st2 = st.constructor();'錯過了'new'關鍵字。它應該是'var st2 = new st.constructor();' – golem