title: Array Index Out Of Bounds error
body: <p>Okay so I am getting an error for my code that is trying to count how many of each integer there are in the array. And so im not sure how to fix it. Im getting the error on the while loop at the bottom.  Any help would be appreciated. Thanks.</p>
  
  <pre><code>            if (ndx != array.length)
                  while (array[ndx] == array[ndx + 1])
                      ndx++;
  </code></pre>