title: Count Points in JS
body: <p>I'm currently trying to make a simple Dice Game in JS but I'm stuck at the counting section.</p>
  
  <p>I need to roll the dice, and count them like in Poker (pair, double pair, brelan, flush, etc.).</p>
  
  <p>It's a 2-players game. Here's my code:</p>
  
  <pre><code>    var boulier = [1, 2, 3, 4, 5, 6];
      var done = false;
  
      for (var i = 1; i &lt; 6; i++)
      {
          var number = Math.floor((Math.random() * 6) + 1);
          tabWinner[i] = number;
          document.getElementById("p1_de_"+i).src = "de_" + number + ".jpg";
          if (i == 5)
          {
              done = true;
          }
      }
  </code></pre>
  
  <p>It simply get 5 random number between 1 and 6 and it display the linked image.</p>
  
  <p>I need to count points like in poker but I don't know how I can compare multiple array items...</p>
  
  <p>If someone can help me couting those points, it would be appreciated!</p>