I am trying to remove object if object matches, I dont want to compare any object key, I just want to compare whole object with array of object, and if it matches, then I have to remove that object from original array.
let originalArray = [
{name: 'abc', country: 'eng'},
{name: 'xyz', country: 'ind'},
{name: 'pqr', country: 'us'}
]
let objectToBeRemove = [
{name: 'pqr', country: 'us'}
]
console.log(originalArray);
Expected output:
[
{name: 'abc', country: 'eng'},
{name: 'xyz', country: 'ind'}
]
I am not able to figure out how can I compare object, I can do it by id or any key, but I am making generic thing, so may be in few cases ID is not present, that's why I want to compare object