instanceof

B.prototype=new A();或B.prototype=A.prototype;之后

var b=new B(); b instanceof A ==true;b instanceof B ==true;

instanceof操作符和isPrototypeOf()函数,只要原型链出现过,就为true

posted @ 2016-04-08 16:52  miaolq  阅读(146)  评论(0)    收藏  举报