Iterating through an array in javascript? : <p>OK so here's my array...</p>

<pre><code>var cars  = new Array("Golf", "Audi", "Merc", "Mini");
</code></pre>

<p>I am trying to simply iterate through it... simple eh? errrr.
I have tried...</p>

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

<p>as well as...</p>

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

<p>and even...</p>

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

<p>Also I might add that I have also tried " i &lt; cars.lenght; " (omitting the empty
brackets to the function call).
None of these work. I know this is really basic so... can anyone tell me what
I am doing wrong?</p>
