IE8 gets caught in an infinite loop with array push
<p>I am confused the following loop causing an infinite loop in IE8</p>

<pre><code>for (var i in theArray) {
            this.theArray.push(theArray[i]);
}
</code></pre>

<p>IE8 get caught in an infinite loop which I don't understand why because <code>this.theArray</code> is a global array while <code>theArray</code> is a local variable.</p>

<p>If I had something like the following I would understand that an infinite loop would occurs:</p>

<pre><code>for (var i in theArray) {
            theArray.push(theArray[i]);
}
</code></pre>

<p>This only happens in IE8. Does IE8 treat variables and scoping differently?</p>

<p>EDIT</p>

<p>Here is what I have within an object</p>

<pre><code>this.theArray = new Array();

this.selection = function(theArray) {
    for (var i in theArray) {
        this.theArray.push(theArray[i]);
    }
}
</code></pre>

<p>EDIT</p>

<p>I found out that I am pass the global variable into the function as an argument. Duh! Why does this not work in IE8?</p>
