What would be the most efficient way to deep compare objects inside an array and return the duplicates? I cannot compare by a property, the objects have to exactly the same.
The array will have hundreds of objects and performance is important.
I have thought of hashing the objects with a sha1 (or different) algorithm and then storing the hash as an additional property of the object and then comparing the hashes. Would that be a reliable way of pinpointing the duplicates?
Another option is doing 2 for loops with lodash isEqual but I am afraid that's not going to be fast enough. What are my options?