AlgoDaily Solution

1function instanceOfClass(obj, targetClass) {
2    if (!obj || typeof obj !== 'object') return false
3    if (!target.prototype) throw Error
4
5    if (Object.getPrototypeOf(obj) === target.prototype) {
6        return true
7    } else {
8        return instanceOfClass(Object.getPrototypeOf(obj), target)
9    }
10}

Community Solutions

Community solutions are only available for premium users.

Access all course materials today

The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.

Returning members can login to stop seeing this.

JAVASCRIPT
OUTPUT
Results will appear here.