function myInstance(instance,origin){ if(instance===null) return false const type=typeof instance if(type !=='function' && type!=='object'){ return false } let tempInstance=instance while(tempInstance){ if(tempInstance.__proto__==origin.prototype){ return true } else tempInstance=tempInstance.__proto__ } return false } console.log(myInstance([],Array))