I have been having trouble trying to figure out how to get this to work.
Basically, I have two arrays. These arrays will contain objects.
The first array, is an array of objects containing the user's favourite stations.
The second array, is an array of objects containing the stations that need to be removed.
I'd like to compare the first and second array, and return a new array that contains the stations that were not in in the remove stations array...
For example...
const favourites = [{ station_name: 'Kyle of Lochalsh', crs_code: 'KYL' }, { station_name: 'Connel Ferry', crs_code: 'CON' }, { station_name: 'Oban', crs_code: 'OBN' }]
const toBeRemoved = [{ station_name: 'Kyle of Lochalsh', crs_code: 'KYL' }]
I would then expect an array containing the other 2 stations to be returned...
I have spent hours trying to figure out how to do it, but just doesn't seem to work!!
TIA