How to select same objects in two arrays using jQuery?
<p>I have a situation where I have two arrays of objects. I want select same objects from both arrays and show it. For instance I have following UL (<a href="http://jsfiddle.net/concypt/StPew/6/" rel="nofollow">You can see it at jsFiddle</a>):</p>

<pre><code>&lt;ul&gt;
&lt;li id="one" class="color pro"&gt;one&lt;/li&gt;
&lt;li id="two" class="color pro"&gt;two&lt;/li&gt;
&lt;li id="three" class="color"&gt;three&lt;/li&gt;
&lt;li id="four" class="color"&gt;four&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I am using following script to show same objects. </p>

<pre><code>var activeElementsColors = $("ul li.color");
var activeElementsPro = $("ul li.pro");                             

var activeElements = activeElementsPro.filter(function(el) {  
return $.inArray(el, activeElementsColors) &gt; -1;
});

activeElements.show();
</code></pre>

<p>I know I can use $("li.color.pro").show() but above one is just an example. real code is complex than this. </p>
