instanceof

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

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

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

原文地址:https://www.cnblogs.com/miaolq/p/5368838.html