instanceof & new & typeof 原理
# instanceof 原理
instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上。
语法 object instanceof constructor
参数 object(某个实例对象) 、 constructor(某个构造函数)
本质上 instanceof 运算符用来检测 constructor.prototype 是否存在于参数 object 的原型链上。
function _instanceof(target, origin) { // 这里需要加层判断 if (typeof target !==...
more...