为什么判空会过滤掉#和&字符串?
<!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);
//将数组内容输出,完成达到的效果。
var anArr = new Array();
for(var i = 0; i < arr.length; i++){
var str = arr[i];
if(str != null) {
anArr[str.length-1] = arr[i];
}
}
for(var i = 0; i<anArr.length; i++) {
document.write(anArr[i] + "<br />");
}
</script>
</head>
<body>
</body>
</html>