SOURCE

function isInstanceOf(obj, fn) {
    console.log(obj, fn)
    const a = fn.prototype
    var cp = obj.__proto__
    while (cp) {
        if (cp === a) {
            return true
        }
        cp = cp.__proto__
    }
    return false
}
console.log(isInstanceOf(1, Array))
console 命令行工具 X clear

                    
>
console