1// Join Without Dupes.
2const joinWithoutDupes = (A, B) => {
3 const a = new Set(A.map(x => x.item))
4 const b = new Set(B.map(x => x.item))
5 return [...A.filter(x => !b.has(x.item)), ...B.filter(x => !a.has(x.item))]
6}
7
8// Proof.
9const output = joinWithoutDupes([{item:"apple",description: "lorem"},{item:"peach",description: "impsum"}], [{item:"apple", description: "dolor"},{item:"grape", description: "enum"}])
10console.log(output)