🤪🤪🤪请教一下这里为什么要这样写呢?

function extend (child, parent) {
var F = function () {};
F.prototype = parent.prototype;
child.prototype = new F();
child.prototype.construtor = child;

// ? 实在不知道这里为什么要这样
child.parent = parent.prototype;

if(!parent.prototype.contrucotor == Object.prototype.constructor){
parent.prototype.constructor = parent;
}
}
展开
12