function myInstanceof (left, right) {
let pt = right.prototype
while ((left = left.__proto__)) {
if (left === pt) {
return true
}
}
return false
}
class Person {
constructor () {
this.name = 'Person'
console.log(this.name)
}
}
let p = new Person
console.log(myInstanceof(p, Array))