function Instanceof(obj, pro) {
obj = obj.__proto__;
pro = pro.prototype;
while (obj) {
if (obj === pro) return true;
obj = obj.__proto__;
}
return false;
}
console.log(Instanceof([], Function));
手写js的instanceof方法
おすすめ
転載: blog.csdn.net/weixin_43595755/article/details/118298088
おすすめ
ランキング