// instanceOf const _instanceOf = (obj, func) => { if (obj === null || typeof obj !== 'object') { return false } let proto = Object.getPrototypeOf(obj) while (true) { if (proto === func.prototype) { return true } else if (proto === null) { return false } else { proto = Object.getPrototypeOf(proto) } } }