title: Get random item from array, within a for loop, then remove from array
body: <p>I am writing a script that onload will add a class to a random 4 of 12 DIV's and then remove the ID of the DIV from the array.</p>
  
  <p>I have an array setup with all 12 DIV ID's in it.</p>
  
  <p><strong>Sometimes when I reload the page, 4 DIV'S have that class and other times only 3 DIV's have that class.</strong></p>
  
  <p>Kinda stuck on why this is happening. <strong>I commented out the remove from array code</strong> to see if that was the issue, but still same problem.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>//Randomize Which Shoes Are Positive And Negative
  function randomizeShoes(){
      allGroundShoes = new Array('ground_black_1','ground_black_2','ground_brown_1','ground_brown_2','ground_clown_1','ground_clown_2','ground_disco_1','ground_disco_2','ground_moccasins_1','ground_moccasins_2','ground_red_1','ground_red_2');
      for(var i=0; i &lt; 4; i++){
          randomAllGroundShoes = allGroundShoes[Math.floor(Math.random() * allGroundShoes.length)];
          $('#'+randomAllGroundShoes+'').addClass('shoeNegitive');
          //randomShoeID = allGroundShoes.indexOf('randomAllGroundShoes');
          //if(randomShoeID != -1){ allGroundShoes.splice(randomShoeID, 1); }
      }
  }
  </code></pre>