as to your code,
B as a function has an own property named "prototype". B.prototype.constructor is B. This is the default behavior.
ln#11 and ln#12 attempts to change the default and should always come together in that:
ln#11 changes B's prototype; and if you changes B's prototype to C, you should set C's own property "constructor" to B. In this way you can avoid a pervert case that a consturctor(X)'s constructed object's constructor(not own but inherited) is not X.
【 在 xiatianup (李 ,只是期待夏天!!) 的大作中提到: 】
: 根据说法1,它应当指向A,因为第11行表明了原型B的一切从A继承(从new A创建的原型B的内容)而来。
: 根据说法2,原型B的constructor应当指向它自己,B。
: 那这2个说法显然是有点冲突啊。
: ...................
--
修改:a0123456789q FROM 183.95.135.*
FROM 183.95.135.*