首先我们先介绍一下instanceof的原理: instanceof主要是检测某个构造函数的原型对象在不在某个原型链上
function myinstanceof (left,right) { let rightProto = right.prototype; leftProto = left._proto_; while (true) { if(leftProto === null ) return false; if(leftProto === rightProto) return true; leftProto = left._proto_; } }