This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JavaScript Operators

The typeof Operator

The typeof operator returns the type of a variable or an expression.

document.getElementById("demo").innerHTML = 
typeof "" + "<br>" +
typeof "John" + "<br>" + 
typeof "John Doe" + "<br>" + 
typeof 45 + <br> +
typeof {age:50};
Legend

string, number, object