Why is the JS Array skipping certain entries when running the splice method within a loop?
<p>I have an array:</p>

<pre><code>var productIds = new Array("1","6","7","Product-Total","ccFirst","ccLast","email","ccExpMonth","ccExpYear","billingAddress","billingCity","billingState","billingZip");
</code></pre>

<p>I want to delete a value if it is not a number:</p>

<pre><code>for(var i=0; i&lt;productIds.length; i++){
   if(isNaN(Number(productIds[i]))) {  
       productIds.splice(i,1);          
   }
}
</code></pre>

<p>It seems the splice method is affecting the positions of the values.</p>

<p>I found this solution(<a href="http://stackoverflow.com/questions/9882284/looping-through-array-and-removing-items-without-breaking-for-loop">Looping through array and removing items, without breaking for loop</a>) which is what I think I need, but I can't figure out how to implement their answers for my code. </p>

<p>How can I fix my problem?</p>

<p>btw, I posted a more detailed jsFiddle: <a href="http://jsfiddle.net/fte3m/2/" rel="nofollow">http://jsfiddle.net/fte3m/2/</a></p>
