title: Need to reset just the indexes of a Javascript array
body: <p>I have a <code>for</code> loop which returns an array.</p>
  
  <p>Return:</p>
  
  <pre><code>1st loop:
  arr[0]
  arr[1]
  arr[2]
  arr[3]
  </code></pre>
  
  <p>Here the length I get is <code>4</code> (Not a problem).</p>
  
  <p>Return:</p>
  
  <pre><code>2nd loop
  arr[4]
  arr[5]
  arr[6]
  arr[7] 
  arr[8] 
  </code></pre>
  
  <p>Here the length I get is <code>9</code>.</p>
  
  <p>What I want here is the actual count of the indexes i.e I need it to be <code>5</code>. How can I do this. And is there a way that when I enter each loop every time it starts from <code>0</code> so that I get proper length in all the loops?</p>