作用
instanceof
的作用是用来判断 一个对象是否是某个类或构造函数的实例
如下:
let arr = []; |
instanceof 在查找的过程中会遍历左边变量的原型链,直到找到右边变量的 prototype,若查找失败,返回 false,成功则返回 true
实现
/** |
instanceof
的作用是用来判断 一个对象是否是某个类或构造函数的实例
如下:
let arr = []; |
instanceof 在查找的过程中会遍历左边变量的原型链,直到找到右边变量的 prototype,若查找失败,返回 false,成功则返回 true
/** |
微信支付
支付宝