var arr = ['*','##',"***","&&","****","##*"];
arr[7] = "**";
//数组长度
var l = arr.length;
//删除数组中非*的项
var i = 0;
for(; i < l; i++){
var val = arr[i];
if(val != undefined) {
var newarr = val.split('');
var newl = newarr.length;
for(var j = 0; j < newl; j++){
if(newarr[j] != '*'){
arr.splice(i, 1);
break;
}
}
}
}
下划线的位置是不是只删除了##而留下了‘*',为什么没有打印出来
arr.splice(i, 1);
arr.splice(j, 1);