Suppose i have an array of objects like this
let arr = [
{
abcdef: {name: 'Robin', uid: '123'},
ghijkl: {name: 'Simon', uid: '456'}
},
{
mnopqr: {name: 'Alex', uid: '789'},
abcdef: {name: 'Robin', uid: '123'}
},
{
abcdef: {name: 'Robin', uid: '123'},
stuvwx: {name: 'Julianna', uid: '111'},
yzxwuv: {name: 'Elon', uid: '007'}
}
];
In position of arr[0], arr[1] and arr[2], i define a object and inside that object, i define couple of objects.
Here this abcdef: {name: 'Robin', uid: '123'} is common among the three(arr[0], arr[1], arr[2]). So i need to write a function that returns the common one.
In this case abcdef: {name: 'Robin', uid: '123'}
UPDATE: If there is nothing in common, return false. And two or more in common, return all of them.