Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Operators</h1> <h2>The typeof Operator</h2> <p>The typeof operator returns the type of a variable or an expression.</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = typeof "John" + "<br>" + typeof ("John" + "Doe") + "<br>" + typeof 3.14 + "<br>" + typeof (22 + 66) + "<br>" + typeof true + "<br>" + typeof false + "<br>" + typeof 1234n + "<br>" + typeof x; </script> </body> </html>