一个空变量

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h2>JavaScript 数据类型</h2>
  6.  
  7. <p>空的字符串变量既有值也有类型。</p>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. var car = "";
  13. document.getElementById("demo").innerHTML =
  14. "其值是:" +
  15. car + "<br>" +
  16. "类型是:" + typeof car;
  17. </script>
  18.  
  19. </body>
  20. </html>