JavaScript has a flexible variable type
The flexible nature of JavaScript variable types can lead to confusion as to the particular type of a variable at any given time in a script. To address this concern JavaScript provides the typeof operator. The typeof operator returns the current variable type of the specified variable.