instanceof原理 基于链表结构在原型链上判断数据类型是不是某个类型。因为原型链就是链表结构,所以原型链最终指向为null。 const instanceofs = (target,obj)=>{ let p = target; while(p){ if(p == obj.prototype){ return true; } p = p.__proto__; } return false; }