The instanceof Operator in JavaScript
The instanceof operator expects a left-side operand that is an object and a right-side operand that is the name of a class of objects.
var names = new String("Keith");
names instanceof String;
// returns true
var names2 = "Aoife";
names2 instanceof String;
// returns false (names2 is not a String object)
Leave a Reply