Operators JavaScript Tutorial

Syntax

typeof(variable)
The typeof unary operator determines the type of the variable.
The return values are boolean, number, object, string, or undefined.
The following example uses the typeof Operator to Return the Types for Four Different Variables


    
      Using typeof to determine the type of variables