<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数组</title>
<script type="text/javascript">
//创建数组
var arr=['*','##',"***","&&","****","##*"];
arr[7] = "**";
//显示数组长度
alert(arr.length);
for(var i=0;i<=4;i=i+2)
{
document.write(arr[i]+"<br>");
if(i==0)
{
document.write(arr[7]+"<br>");
}
}
</script>
</head>
<body>
</body>
</html>
你这里arr的总长度为7 ,循环会打印出4个值:arr[0] arr[7] arr[2] arr[4]
请问if那是什么意思,不懂啊
花里胡哨的,0713的话你这个都是0724,另外,数组长度是8不是7,7是索引