Adding to array in for loop doesn't store value properly?
<p>OK.. I really must be crazy. Why would these not print out 3-5 for "a"? I've tried two different methodologies to have the array store 3-5 below, and both of them seem.. obvious. There must be something in the underlying translation that I'm just not seeing.</p>

<pre><code>&lt;script&gt;
    var articlesKey = [];
    for(var i = 3; i &lt; 6; i++) {
        articlesKey.push(i);
        document.write('&lt;br&gt;i:'+i);
    }
    for (a in articlesKey)
        document.write("&lt;br&gt;a:"+a);


    articlesKey = [];
    var count = 0;
    for(var i = 3; i &lt; 6; i++) {
        articlesKey[count] = i;
        document.write('&lt;br&gt;i:'+i);
        count++;
    }
    for (a in articlesKey)
        document.write("&lt;br&gt;a:"+a);
&lt;/script&gt;
</code></pre>

<p>It prints out:</p>

<pre><code>i:3
i:4
i:5
a:0
a:1
a:2
i:3
i:4
i:5
a:0
a:1
a:2
</code></pre>
