Does the Javascript 'for-in' function, return just an index?
<p>This is a method I tried to run:</p>

<pre><code>function SayHello() {
    cars = new Array();
    cars[0] = "Toyota";
    cars[1] = "Mitsubishi";
    cars[2] = "Honda";

    for (car in cars) {
        alert(car);
    }
}
</code></pre>

<p>This returned:</p>

<pre><code>0
1
2
</code></pre>

<p>When I changed the code to this:</p>

<pre><code>function SayHello() {
    cars = new Array();
    cars[0] = "Toyota";
    cars[1] = "Mitsubishi";
    cars[2] = "Honda";

    for (car in cars) {
        alert(cars[car]);
    }
}
</code></pre>

<p>It returned the names correctly.</p>

<p>My question is, does the for-in loop just return an index in an orderly fashion? Thanks.</p>
