The instanceof Operator
The instanceof operator tests whether the prototype property of a constructor appears anywhere in the prototype chain of an object. It returns a boolean.
Code Example
Section titled “Code Example”function Car(make) { this.make = make;}const tesla = new Car("Tesla");console.log(tesla instanceof Car); // trueconsole.log(tesla instanceof Object); // trueconsole.log(tesla instanceof Array); // false