我有 2 个数组,在这 2 个中我需要一个数组的输出,它只存在于第 2 个数组中。我试过了,但没有重复;
var x = ["apple","2","3", "4", "3", "x", "M"], y = ["4","5","apple","zoo"];
var z = y.filter(function(){
return $.inArray(y,x) === -1;
})
console.log(z); i am looking for ["5","zoo"]
我如何过滤这样的..有什么帮助吗?