9_数组.html 588 B

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <script>
  11. // var a = [0,1,6,3,4] //数组当中的第一个数字 索引为0
  12. // console.log(a)
  13. var b = ['hahahah',true,123]
  14. console.log(b)
  15. var a = new Array()
  16. a[0] = 'xixixi'
  17. a[3] = 'hehehe' //empty 空占位
  18. console.log(a)
  19. for(var i=0;i<b.length;i++){
  20. console.log(b[i])
  21. }
  22. </script>
  23. </body>
  24. </html>