87,914
社区成员
发帖
与我相关
我的任务
分享
function Odemo1(){}
Odemo1.prototype.sayName=function(){}
function Odemo2(){}
Odemo2.prototype=new Odemo1();
var a=new Odemo2();
alert(a instanceof Odemo1); //显示true
alert(a instanceof Odemo2); //显示true
alert(a instanceof Object); //显示true
alert(a.constructor==Odemo1); //显示true
alert(a.constructor==Odemo2); //为什么这里显示false
alert(Odemo1.prototype.isPrototypeOf(a)); //显示true
alert(Odemo2.prototype.isPrototypeOf(a)); //显示true