typeof Operator

Top  Previous  Next

Operator:  typeof

Syntax:

typeof expression

 

The result of the typeof operator is a string denoting the type of expression, as shown in this table:

 

Type

Result

Undefined

"undefined"

Null

"object"

Boolean

"boolean"

Number

"number"

String

"string"

Object

"object"

Function

"function"