So now we have ...<p><pre><code>    for each (var x in a) ...  &lt;&lt;Firefox only??&gt;&gt;
    for (var x of a) ...  &lt;&lt;ES6&gt;&gt;
    for (var x in a) ...
    a.forEach(callback[, thisArg])
</code></pre>
Knowing JS, each of them have their own quirks probably.