W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h2>JavaScript 数据类型</h2> <p>任何变量均可通过设置值为 undefined 进行清空。其类型也将是 undefined。</p> <p id="demo"></p> <script> var car = "Porsche"; car = undefined; document.getElementById("demo").innerHTML = car + "<br>" + typeof car; </script> </body> </html>