title: Find element that appears odd number of times
body: <p>I'm trying to solve this exercise of finding the number that appears an odd number of times in an array. I have this so far but the output ends up being an integer that appears an even number of times. For example, the number 2 appears 3 times and the number 4 appears 6 times, but the output is 4 because it counts it as appearing 5 times. How can it be that it returns the first set that it finds as odd? Any help is appreciated!</p>
  
  <pre><code>         function oddInt(array) {
           var count = 0;
           var element = 0;
           for(var i = 0; i &lt; array.length; i++) {
             var tempInt = array[i];
             var tempCount = 0;
               for(var j = 0; j &lt;array.length; j++) {
                  if(array[j]===tempInt) {
                  tempCount++;
                    if(tempCount % 2 !== 0 &amp;&amp; tempCount &gt; count) {
                    count = tempCount; 
                    element = array[j];
                  }
                 }
                }
               }
             return element;
             }
             oddInt([1,2,2,2,4,4,4,4,4,4,5,5]);
  </code></pre>