The typeof
operator in Javascript returns the data type of the operand in the form of a string.
Look at the syntax of the typeof
operator below.
The code snippet below illustrates the usage of the typeof
operator.
console.log(typeof 19);console.log(typeof 'Educative');console.log(typeof false);// a variable declared but not initialized or definedvar x;console.log(typeof x);