去掉数组中非数字字符,并给每个数字+1
输入:[1, 2, ‘a’, ’ b’ ,8, 91 ,‘adr’]
输出:[2, 3, 9 , 92]
var arr=[1,2,3,4,"a","b","c",89]
for(var i=arr.length;i>=0;i--){
if(!(typeof(arr[i])=="number")){
arr.splice(i,1)
}else{
arr[i]+=1
}
}
console.log(arr)