Javascript examples for Operator:typeof
here is the rules of typeof
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = typeof "Hi" + "<br>" + typeof 3.14 + "<br>" + typeof NaN + "<br>" + typeof false + "<br>" + typeof [1, 2, 3, 4] + "<br>" + typeof {name:'Name', age:34} + "<br>" + typeof new Date() + "<br>" + typeof function () {} + "<br>" + typeof myNumber + "<br>" + typeof null;/*from w ww . j a v a 2s. c om*/ </script> </body> </html>