JavaScript
JavaScript Array(数组) 对象
创建数组, 为其赋
源代码:
点击运行 »
<script> var i; var mycars = new Array(); mycars[0] = "Saab"; mycars[1] = "Volvo"; mycars[2] = "BMW"; for (i = 0; i < mycars.length; i++) { document.write(mycars[i] + "<br>"); } </script>
运行结果:
点击运行 »