<script> //创建数组 var arr = ['*', '##', "***", "&&", "****", "##*"]; arr[7] = "**"; //显示数组长度 alert(arr.length) var a = [0, 7, 2, 4] for (var i = 0; i < a.length; i++) { var b = a[i] document.write(arr[b] + '<br>') } </script>
//创建数组
var arr = ['*','##',"***","&&","****","##*"];
arr[7] = "**";
//显示数组长度
alert(arr.length);
//将数组内容输出,完成达到的效果。
for(i=0;i<arr.length;i++){
document.write(arr[i]+"<br/>");
}