I have this annoying conundrum in firebase whereby I need to compare an object being returned to me with an array
I need this method filling out
const removeAlreadySeenUsersFromQueue = (newUsers, likedUsers) => {
}
basically newUsers is an array of objects. each object has an id that I'm interested in.
then likedUsers is coming back as an array of objects of objects. looking something like this: [{object1: {}, object2: {}, object3: {}]
basically an array of length one. inside each object there is an id key that I'm interested in. I basically want to compare both of those and return an array when someone's id only appers in newUsers and not in likedUsers. I figure I need to use object.keys()
potentially but currently I can't get anything to work
example below:
[{id: 4444}, {id: 5555}, {id: 6666}]
[{object1: {id: 4444}, object2: {id: 55555}, object3: {id: 121241}}]
after comparing these 2, I would only want {id: 6666}
returned to me.