for in loop and the delete operator
<p>I noticed that when enumerating the properties of an object, that it seems like a snapshot of the current properties is taken at start of the loop, and then the snapshot is iterated. I feel this way because the following doesn't create an endless loop:</p>

<pre><code>var obj = {a:0,b:0}, i=0;
for (var k in obj) {
    obj[i++] = 0;
}
alert(i) // 2
</code></pre>

<p>demo <a href="http://jsfiddle.net/kqzLG/">http://jsfiddle.net/kqzLG/</a></p>

<p>The above code demonstrates that I'm adding new properties, but the new properties won't get enumerated. </p>

<p>However, the delete operator seems to defy my snapshot theory. Here's the same code, but deleting a property before it gets enumerated.</p>

<pre><code>var obj = {a:0,b:0}, i=0;
for (var k in obj) {
    i++;
    delete obj.b;
}
alert(i) // 1
</code></pre>

<p>demo <a href="http://jsfiddle.net/Gs2vh/">http://jsfiddle.net/Gs2vh/</a></p>

<p>The above code demonstrates that the loop body only executed one time. It would have executed twice if the snapshot theory were true.</p>

<p>What's going on here? Does javascript have some type of hidden iterator that it uses, and the delete operator is somehow aware of it?</p>

<p>-- I realize that I'm assuming something about iteration order- specifically that iteration occurs based off of property insertion time. I believe all browsers use such an implementation.</p>
