📅  最后修改于: 2022-03-11 15:01:14.653000             🧑  作者: Mango
let myArray = ["user1","user2", "", ""]
console.log(myArray)
function cleanArray(_array) {
for (i in _array){
if(_array[i] == ''){
_array.splice(i, 1)
}
}
return _array
}
console.log(cleanArray(cleanArray(myArray)))