Instanz
let result = chars instanceof Set;
console.log(result);
Code language: JavaScript (javascript)
Elated Eland
let result = chars instanceof Set;
console.log(result);
Code language: JavaScript (javascript)
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