typeof operator javascript code example
Example 1: type javascirpt
console.log(typeof 42);
Example 2: how to get type of variable in javascript
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
Example 3: typeof javascript
console.log(typeof 'blubber');
Example 4: check data type in js
var x = "Hello World";
typeof x; // "string"