instance of javascript code example
Example 1: instanceof javascript
var color = "red";
var color2 = {};
color instanceof String // will return true
color2 instanceof Object // will return true
Example 2: js class check if new instance
new Date() instanceof Date; // => true