创建数组 2

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>JavaScript 数组</h1>
  6.  
  7. <p id="demo"></p>
  8.  
  9. <script>
  10. var cars = [
  11. "Audi",
  12. "BMW",
  13. "porsche"
  14. ];
  15. document.getElementById("demo").innerHTML = cars;
  16. </script>
  17.  
  18. </body>
  19. </html>