let literalString = 'This is a literal string';
let stringObject = new String('String created with constructor');
literalString instanceof String; // false, string primitive is not a String
stringObject instanceof String; // true
literalString instanceof Object; // false, string primitive is not an Object
stringObject instanceof Object; // true
stringObject instanceof Date; // false
object instanceof constructor
let result = chars instanceof Set;
console.log(result);
Code language: JavaScript (javascript)
var instanceOfOperator = nameOfObject instanceof typeOfObject;