The typeof Operator
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p id="result"></p> <button onclick="myFunction()">Run</button> <script> function myFunction() { var content = '"Bee" - ' + typeof "Bee" + "<br>"; content = content + 'False - ' + typeof false + "<br>"; content = content + '10.9 - ' + typeof 10.9 + "<br>"; content = content + 'NaN - ' + typeof NaN + "<br>"; content = content + '[1, 2, 3, 4] - ' + typeof [1, 2, 3, 4] + "<br>"; content = content + '{name:"Bee", age:21} - ' + typeof {name:'Bee', age:21} + "<br>"; content = content + 'Date() - ' + typeof Date() + "<br>"; content = content + 'function () {} - ' + typeof function () {} + "<br>"; content = content + 'Freetuts - ' + typeof Freetuts + "<br>"; content = content + 'null - ' + typeof null + "<br>"; document.getElementById("result").innerHTML = content; } </script> </body> </html>
PHÓNG TO