Sorting an object?
<p>How to sort this object lexicographically by its keys:</p>

<pre><code>var obj = {'somekey_B' : 'itsvalue', 'somekey_A' : 'itsvalue');
</code></pre>

<p>so that it outputs like this:</p>

<pre><code>for (k in obj) {
  alert(k + ' : ' + obj[k]); //first "somekey_A : itsvalue"; then "somekey_B : itsvalue"
}
</code></pre>
