1.1.2 Variable Types

Since a variable can hold numerous data types, it is important to ensure that the value of a variable is the expected data type. In JavaScript, this can be done with the typeof operator or method. They both pretty much do the same thing but have syntax differences.

Typeof Operator

Typeof Method

JavaScript Number Quirks

Arrays Multiple Values in One