The typeof Keyword
If you are ever working with a variable and would like to know its data type (number, string, Boolean, etc.) you can use the
typeof operator to figure it out. Here is an example of how to figure out the data type for the variable named
In this example, the word
"number" will appear in the alert window.