diveDylan / blog

My blog, detail is in the issues list
2 stars 0 forks source link

手写instance #44

Open diveDylan opened 4 years ago

diveDylan commented 4 years ago
function instanceFn(left, right) {
    let leftProto = left.__proto__
    while(leftProto) {
     if( leftProto.constructor === right) return true
    leftProto = leftProto.__proto__
  }
  return false
}