Javascript examples for Operator:instanceof
instanceof operator returns true if the specified object is an instance of the specified object:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var cars = ["A","B","C"]; document.getElementById("demo").innerHTML = (cars instanceof Array) + "<br>" + (cars instanceof Object) + "<br>" + (cars instanceof String) + "<br>" + (cars instanceof Number);//w w w . j a v a2s . c o m </script> </body> </html>