JavaScript
JavaScript 数据类型
或者 (literal array)
源代码:
点击运行 »
<!DOCTYPE html> <html> <body> <script> var i; var cars = new Array(); cars[0] = "Saab"; cars[1] = "Volvo"; cars[2] = "BMW"; for (i = 0; i < cars.length; i++) { document.write(cars[i] + "<br>"); } </script> </body> </html>
运行结果:
点击运行 »