typeof

use the typeof operator to find the data type of a JavaScript variable ; "void" "string" "number" "function" "object"

Syntax

typeof(var)

Returns

returns (string) either "void" "string" "number" "function" or "object"

Parameters

var (void/string/number/function/object)
the variable to check the type of