javascript Operators typeof

typeof 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:

  • boolean
  • function
  • number
  • object
  • string
  • undefined

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") {
    ...
}

1547,Nickname,Homepage or email,Comments here,Add comment