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 object for both objects, arrays, maps, sets, and null.</p> <p>The typeof operator does not return object for functions.</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = typeof {name:'John'} + "<br>" + typeof [1,2,3,4] + "<br>" + typeof new Map() + "<br>" + typeof new Set() + "<br>" + typeof null + "<br>" + typeof function myFunc(){}; </script> </body> </html>