1
我有2個數組,在這2我需要一個數組,只存在於2'nd數組輸出。我試過這個,但沒有回報;如何過濾陣列只有它不在另一個數組值
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"]
如何過濾這樣的..任何幫助嗎?