Javascript splice is breaking on jQuery .each()?
<pre><code>var results = ['one', 'two', 'one hundred', 'three'];
var removal = [];
$.each(results, function(i) {
    removal.push(i);
    if (results[i].indexOf('one') == -1){
        console.log('Removing:' + results[i] + '(' + removal[i] + ')');
        results = results.splice(removal[i], 1);
    }
});
</code></pre>

<p>I have the following code, but it is breaking after it removes the first result.</p>

<p>I want it to remove anything that does not contain the word 'one'.</p>

<p>I am guessing it is breaking because the removal order changes once one has been removed.</p>

<p>What am I doing wrong?</p>
