怎么就undefined了呢,应该是**?怎么arrlen就是8了呢?如何排序?
<!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] = "**";
//显示数组长度
var arrlen=arr.length;
//alert(arrlen);
//将数组内容输出,完成达到的效果。
for(var i=0;i<arrlen;i++){
if((i%2)==false){
document.write(arr[i]+"<br/>");
}
}
</script>
</head>