<p>Does the "for…in" loop in Javascript loop through the hashtables/elements in the order they are declared? Is there a browser which doesn't do it in order?<br>
The object I wish to use will be declared <em>once</em> and will never be modified.</p>

<p>Suppose I have:</p>

<pre><code>var myObject = { A: "Hello", B: "World" };
</code></pre>

<p>And I further use them in:</p>

<pre><code>for (var item in myObject) alert(item + " : " + myObject[item]);
</code></pre>

<p>Can I expect 'A : "Hello"' to always come before 'B : "World"' in most decent browsers?</p>

The elements of an object that for/in enumerates are the properties that don't have the DontEnum flag set. The ECMAScript, aka Javascript, standard explicitly says that "An Object is an unordered collection of properties" (see
http://www.mozilla.org/js/language/E262-3.pdf
section 8.6).
It's not going to be standards conformant (i.e. safe) to assume all Javascript implementations will enumerate in declaration order.