If I have two arrays of objects, like this:
var a1 = [{"a":"b"}, {"b":"c"}, {"d":"e"}],
a2 = [{"g":"h"}, {"a":"b"}, {"i":"j"}]
(note that objects may be of any structure, not so simple)
what is the most efficient way to extract all the objects that are in both arrays?
I checked this question: Finding matches between multiple JavaScript Arrays, but this is not the same...