Javascript For loop doesn't always work in IE
<p>After two days of searching, I'm stuck and could really use some assistance.</p>

<p>I have a javascript array that when iterated through will give me the key to each subsequent array.  This works in all browsers except for some versions of IE.  In some versions of IE, it appears that it first reorders the array in ascending order before returning the key.  Jquery's each function does the same. Is there an equivalent to the javascript for loop that will not reorder the array and would still work for everyone?</p>

<pre><code>var db = new Array();
db[259] = new Array(3);
db[259][0] = "John Smith";
db[259][1] = "Los Angeles";
db[259][2] = "Chicago";

db[917] = new Array(3);
db[917][0] = "Jane Smtih";
db[917][1] = "New York";
db[917][2] = "Tampa";

db[208] = new Array(3);
db[208][0] = "Jack Johnson";
db[208][1] = "Baltimore";
db[208][2] = "Milwaukee";

for(var i in db){document.write(i + " ");}
</code></pre>

<p>In most browsers, the above will output 259 917 208. This is the outcome that I would like.</p>

<p>In some versions of IE, the above will output 208 259 917.  It looks like it orders the keys in ascending order first.  The key is important here as it is the person's ID # and the rank is important (ie, 259 should come before 208). Other functions make reference to db[i] where i is the person's ID #.</p>

<p>Can anyone help?</p>
