Choose if array element repeats itself twice -- Javascript : <p>There is a javascript array</p>

<pre><code>var arr = [0, 1, 2, 2, 3, 3, 5];
</code></pre>

<p>I want to choose elements that repeats twice. In this case its  <code>2</code> and <code>3</code>. and i want attach them into a variable.</p>

<pre><code>var a = 2, b = 3;
</code></pre>

<p>As far as i know there is no built-in function to do that job. How can i do that. Thanks.</p>
