可能重复:
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