for..of语句中如何去除数组中为空的数据

public newArr = [];//声明一个空数组,用来存储不为空的数据 for(let row of arr){ //判读数据不能为空且不能为undefined if(row != "" && row != undefined){ this.newArr.push(row);//将不为空的数据push到新数组中 } }
相关文章
相关标签/搜索