此代码不起作用
var arr1 = ["a", "b", "c"];
var arrayJoin=[];
arrayJoin.concat(arr1.filter(function (val) {
return val == "a";
}));
console.log(arrayJoin);
这很好用
arrayJoin=arr1.filter(function (val) {
return val == "a";
}));
任何想法如何连接过滤器数组?
答案 0 :(得分:1)
怎么样?
arrayJoin = arrayJoin.concat(arr1.filter(function (val) {
return val == "a";
}));