The instanceof operator checks whether an object is an instance of a particular constructor function or class. It traverses the prototype chain of the object, looking for a match with the prototype of the constructor function.
It checks if a specific constructor's prototype exists anywhere in that object's prototype chain.
Even though strings have Object Wrappers, literal primitives are not considered instances of their constructors