코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript DataType</title> </head> <body> <h1>typeof 연산자</h1> <p id="result"></p> <script> document.getElementById("result").innerHTML = (typeof 10) + "<br>"; document.getElementById("result").innerHTML += (typeof "문자열") + "<br>"; document.getElementById("result").innerHTML += (typeof true) + "<br>"; document.getElementById("result").innerHTML += (typeof undefined) + "<br>"; document.getElementById("result").innerHTML += (typeof null); </script> </body> </html>