javascript check if object is a class code example
Example 1: js class check if new instance
new Date() instanceof Date; // => true
Example 2: how to check which class a object is from
if (obj instanceof C) {
//your code
}
new Date() instanceof Date; // => true
if (obj instanceof C) {
//your code
}