The typeof operator can be used in the following way.
var number = 10; var result1 = typeof(number); //number var result2 = typeof number; //number var result3 = typeof "number"; //string
Note that typeof is an operator and not a function and so the parenthesis is not required but it can be used. The only issue that can arise using the typeof operator is when the data type is null. When the value is null, typeof operator returns "object" as the null is an empty object reference.