xxxxxxxxxx
class Person
{
constructor(firstName, lastName)
{
this.firstName = firstName;
this.lastName = lastName;
}
}
function test()
{
const p = new Person();
console.log(p instanceof Person);
}
xxxxxxxxxx
var = ["Apple", "Mango", "Banana"];
console.log(fruits instanceof Array);
console.log(fruits instanceof Object);
console.log(fruits instanceof Number);
console.log(fruits instanceof String);
//Output
true
true
false
false