Union of Array of Objects in JavaScript?
<p>So after searching the interwebz for a few hours I have not found the solution I am looking for.</p>

<p>I have two arrays that contain game objects with a lot of information inside. (e.g. title, slug, thumbnail, summary, genre, release date...).</p>

<p>The <strong><em>Array 1</em></strong> is a collection of objects that match user's interests specified during the registration.</p>

<p>The <strong><em>Array 2</em></strong> is a collection of objects that match purchased games of similar users. (Similar users are those that share common interests)</p>

<p><strong>Problem</strong>: It is possible, and what is happening in my case, there are two identical games - the game in Array 1 is also in Array 2. In the first array the game is there because it matches user's interests. In the second array the game is there because a similar user has bought that game.</p>

<p><strong>Question</strong>: Underscore.js has a nice little function union() <a href="http://underscorejs.org/#union" rel="nofollow">http://underscorejs.org/#union</a> that gives you a union of two arrays, but it does not work with an array of objects, only on primitive values. How could I make it work give me a union of array of objects?</p>
