Typeof

Typeof undefined // "undefined"

typeof 0 // "number"

typeof true // "boolean"

typeof "foo" // "string"

typeof Symbol("id") // "symbol"

*!*
typeof Math // "object"  (1)
*/!*

*!*
typeof null // "object"  (2)
*/!*

*!*
typeof alert // "function"  (3)
*/!*

Operator returns the type of the argument.

Syntax

As an operator: typeof x

Syntax

Function style: typeof(x)

Related concepts

Typeof — Structure map

Clickable & Draggable!

Typeof — Related pages: