Javascript Reference
Categories: Operators

javascript Operators typeof

@March 15, 2008, 1:22 a.m.
typeof Firefox/Netscape/NN 3 IE 3 ECMA 1  

  

The typeof operator returns one of six string descriptions of the data type of a value. Those returned types are:

The object type includes arrays, but the operator provides no further information about the type of object or array of the value (see the instanceof operator).

 
Example
 
if (typeof someVar == "string") {
    ...
}

Powered by Linode.