Difference and intersection of two arrays containing objects

You could define three functions inBoth, inFirstOnly, and inSecondOnly which all take two lists as arguments, and return a list as can be understood from the function name. The main logic could be put in a common function operation that all three rely on. Here are a few implementations for that operation to choose from, … Read more