如何实现instanceof
instanceof 运算符用于测试构造函数的 prototype 属性是否出现在对象原型链中的任何位置
function instance_of(obj, Obj) { obj = obj.__proto__; let Obj_Prototype = Obj.prototype; while (true) { if (obj === null) return false; if (obj === Obj_Prototype) { return true; } obj = obj.__proto__; } }

浙公网安备 33010602011771号