for (var propertyName in object) vs for (propertyName in object)?
<p>Which one of those two methods for iterating over the property names of an object are preferable?</p>

<pre><code>for (var propertyName in object) {

}
</code></pre>

<p>vs.</p>

<pre><code>for (propertyName in object) {

}
</code></pre>

<p>I know in the second example, propertyName becomes a global variable, which is something to avoid, so I guess the first one would be better, right?</p>
