For-in with a hard-coded array
<p>Rookie JS question here:</p>

<pre><code>for( var p in ['nodeName', 'nodeType', 'tagName', 'localName'] ) {
    console.log( p + '=' + all[i][p] + '\n' );
}
</code></pre>

<p>I expected to see something like</p>

<pre><code>nodeName=DIV
</code></pre>

<p>Instead, I get</p>

<pre><code>0=undefined
</code></pre>

<p>Am I forced to assign the array to a variable, so that I can index into it?  Is there a way to use this syntax in the for-in and retrieve the string from the array?</p>

<p>Thanks!</p>
