title: Javascript indexOf method not working with integers in Object
body: <p>I have made a fiddle:</p>
  
  <p><a href="http://jsfiddle.net/csS24/" rel="nofollow">http://jsfiddle.net/csS24/</a></p>
  
  <p>I'm trying to get the code to a point, that it never ever shows the same two items at once or when one item is clicked, it never pulls back that same one from the array, just seem to be struggling a little with the logic and the indexOf method is behaving oddly.</p>
  
  <pre><code>var justAdded = [];
  justAdded['first'] = 0;
  justAdded['second'] = 1;
  
  newHtml = returnRandom().split('|');
  
  justAdded[e.id] = parseInt(newHtml[0], 10);
  
      if(justAdded.indexOf(parseInt(newHtml[0], 10)) == -1){
          e.style.opacity = 0;
          e.innerHTML = newHtml[1];
          e.style.opacity = 1;
          e.setAttribute('data-id', newHtml[0]);
      } else {
          uniq(clickedEl);
      }
  
  var returnRandom = function(){
      return options[Math.floor(Math.random() * options.length)]
  };
  </code></pre>
  
  <p>e.id will be equal to 'first' or 'second'. returnRandom() will grab a random value from the options array:</p>
  
  <pre><code>var options = [
      '0|Flash',
      '1|Internet Explorer',
      '2|Java',
      '3|!important'
  ];
  </code></pre>