12345678910111213141516171819202122232425262728293031323334353637383940 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- var a = [1, 2, 3, 4, 5, 6]
- console.log(a)
- var b = ['小明', 123, true]
- console.log(b)
- /* 数组里面存放任何的值 */
- var d = new Array()
- d[0] = 11
- d[3] = 22
- d[4] = 55
- console.log(d[2])
- //empty 空占位符
- var x = [666, 777, 888]
- x[1] = 999
- console.log(x)
- for (var i = 0; i < x.length; i++) {
- console.log(i)
- }
- </script>
- </body>
- </html>
|