function instance_of(leftVaule, rightVaule) {
let rightProto = rightVaule.prototype; // 取右表达式的 prototype 值
leftVaule = leftVaule.__proto__; // 取左表达式的__proto__值
while (true) {
if (leftVaule === null) {
return false;
}
if (leftVaule === rightProto) {
return true;
}
leftVaule = leftVaule.__proto__
}
}
链接收录:
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf
https://blog.csdn.net/yiyan12/article/details/79529006
https://www.jianshu.com/p/666c2c5767b5
https://www.jianshu.com/p/44ba37660b4a
bind实现:https://www.cnblogs.com/heshan1992/p/6667596.html
toString和valueOf https://segmentfault.com/a/1190000008038678?utm_source=tag-newest