var d = new Date(); // Create a new object with the Date( ) constructor
d instanceof Date; // Evaluates to true; d was created with Date( )
d instanceof Object; // Evaluates to true; all objects are instances of Object
d instanceof Number; // Evaluates to false; d is not a Number object
var a = [1, 2, 3]; // Create an array with array literal syntax
a instanceof Array; // Evaluates to true; a is an array
a instanceof Object; // Evaluates to true; all arrays are objects
a instanceof RegExp; // Evaluates to false; arrays are not regular expressions
If the lefthand operand of instanceof is not an
object, or if the righthand operand is an object that is not a
constructor function, instanceof returns false. On
the other hand, it returns a runtime error if the righthand operand
is not an object at all.