JavaScript typeof
The typeof operator is used to get the data type its operand. The operand can be either a variable, a function or an object.
The operator return the data type
The Syntax of typeof operator is as follows:
typeof(operand)
There are some typeof operators
Example
typeof “abc” // returns string
typeof 10 // returns number
typeof true // returns boolean
typeof [1,4,7,8] // returns object
Example
Output
number
string
boolean
undefined