I've found a lot of similar questions but they explain how to remove duplicate objects. In this case, I need to create a new array that doesn't include objects which were found in two arrays.
const firstArray = [
{firstName: 'John', lastName: 'Doe'},
{firstName: 'Sara', lastName: 'Connor'},
{firstName: 'Mike', lastName: 'Hunt'},
{firstName: 'Steve', lastName: 'Irvine'}
];
const secondArray = [
{firstName: 'John', lastName: 'Doe'},
{firstName: 'Sara', lastName: 'Connor'}
];
The expected result for the previous sample of data should be:
const result = [
{firstName: 'Mike', lastName: 'Hunt'},
{firstName: 'Steve', lastName: 'Irvine'}
];