I would just post this as a comment, but I don't have the required rep.
I don't know if this would work in your situation, but what you could do is convert to JSON, then compare the strings:
JSON.stringify(firstObject) === JSON.stringify(secondObject)
Was looking around a bit more, and found another stackoverflow post with a similar question. There is a solution similar to mine, but what I found most interesting was the second solution, not chosen as the answer, I think it has what you need: Object comparison in JavaScript