Prototypes & OOP
Implement Custom instanceof
easyJS SpecificJS / TS3 tests
Problem Statement
Implement `myInstanceOf(object, constructor)` that checks if the prototype property of a constructor appears anywhere in the prototype chain of an object.
Examples
Example 1:
class Animal {}
class Dog extends Animal {}
const d = new Dog();
myInstanceOf(d, Dog); // true
myInstanceOf(d, Animal); // true
myInstanceOf(d, Array); // falseJavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.