JavaScript Instanceof
JavaScript Instanceof Operator
The instanceof operator return true if the specified object is an instance of the specified object.
The Syntax of instanceof operator is as follows:
var result = instanceof;
JavaScript Data Types
-
Unlike in C, C++ and Java, there are no explicit data types in JavaScript
-
Nevertheless, it recognizes & distinguishes among the following types of values:
-
Numbers, e.g., 23, 4.3, -230, 4.4e-24
-
Booleans, e.g., true, false
-
Strings, e.g., “hello”, “What’s the time?”
-
Undefined
Example
Output
instanceof Operators
true
true