To detect whether an object is an instance of a constructor, we can simply use the instanceof operator:
const component = new Component();component instanceof Component;
The instanceof operator will be covered in more detail in Chapter 8, Operators.