# instanceof

function instanceOf(left,right) {

    let proto = left.__proto__;
    let prototype = right.prototype
    while(true) {
        if(proto === null) return false
        if(proto === prototype) return true
        proto = proto.__proto__;
    }
}

1
2
3
4
5
6
7
8
9
10
11
最后更新时间: 9/26/2020, 7:38:09 PM