简易实现 instanceOf

function instanceOf(left, right) {
    if (typeof left !== 'object' || left === null) {
        return false;
    }

    while(true) {
        if (left === null) {
            return false;
        }

        if (left.__proto__ === right.prototype) {
            return true;
        }

        left = left.__proto__;
    }
}
原文地址:https://www.cnblogs.com/LeoXnote/p/15593805.html