title: Deleting an array element
body: <p>If <code>BOOK_COPY_ID</code> and <code>id</code> are both equal at 0th index, my whole array is becoming empty. If I put return, it is also getting deleted.</p>
  
  <p>This is my code:</p>
  
  <pre><code>var i = 0;
      while(i &lt; bookLoop.length)
      {
          if(parseInt(bookLoop[i].BOOK_COPY_ID) == parseInt(id))
          {
             bookLoop.splice(i);           
          }
          i++;
      }
  </code></pre>