JavaScript for/in loop with unexpected output
<p>I'm not sure why this outputs <code>undefined</code> for the property names of the <code>document</code> object. I think it has something to do with the variable expression <code>myArray[i++]</code>. I could make this a simple primitive variable and I'll get all the property names, but I would like all the property names saved into an array. Thank you for your help in advance!!</p>

<pre><code>var myArray = [];
var i = 0;
for (myArray[i++] in document) {
document.write(myArray[i] + "&lt;/br&gt;");
}
</code></pre>
