SOURCE

// instanceof
const myInstanceOf = function (left, right) {
    while (left) {
        if (Object.getPrototypeOf(left) === right.prototype) {
            return true
        }
        left = Object.getPrototypeOf(left)
    }
    return false
}

console.log(myInstanceOf(function () {}, Function))
console 命令行工具 X clear

                    
>
console