-1
如何獲得Javascript中兩個關聯數組的差異。 例如:JavaScript中關聯數組上的數學集函數
var arr1[0] = { name : 'test1' , type : 'test2' };
var arr1[1] = { name : 'test2' , type : 'test3' };
var arr2[0] = { name : 'test1' , type : 'test2' };
var arr2[1] = { name : 'test3' , type : 'test4' };
我需要輸出這樣
if Intersection() :
arr3[0] = { name : 'test1' , type : 'test2' }
if difference arr1-arr2 :
arr4[0] = { name : 'test2' , type : 'test3' };
if difference arr2-arr1 :
arr5[0] = { name : 'test3' , type : 'test4' };
我沒有找到屬於我的搜索關聯數組什麼。