Get variable type JavaScript


Description
Get the type of a variable.


var foo = 123;
var type_name = typeof foo;
Returns: "undefined", "object", "boolean", "number", "string", "symbol", "function" <br>
Note: NULL is considered an "object".

SEE ALSO