<script type="text/javascript"> var x var mycars = new Array() mycars[0] = "a" mycars[1] = "b" mycars[2] = "c" for (x in mycars) { document.write(mycars[x] + "<br />") } </script>
x不用设置初始值吗?
这个语句输出了所有的数组元素,与document.write(mycars)有什么区别?
ruibin
ruibin
wblovezqy
相关分类