I have an array like this
const ex = [
{
name: 'John',
sender: "12345678",
receiver: {
name: "simi",
age: 20,
city: "New York"
},
time: 12:30 am
},
{
name: 'Jane',
sender: {
name: "simi",
age: 20,
city: "New York"
},
receiver: "12345678",
time: 1:00 pm
}
]
In this array, the sender property value in the first object is equal to the receiver property value in the second object. Is there a way I can check and produce only one occurence of this value, that is, just one object in which the value is present