title: Sorting associative array / javascript object by keys alphabetically
body: <p>How do i order this object by the keys, Alphabetically?</p>
  
  <p>I tried:</p>
  
  <pre><code>racks.sort();
  </code></pre>
  
  <p>The object racks is filled like this:</p>
  
  <p>(Statdev is a string, and kartnr and bitnrk are integers)</p>
  
  <pre><code>racks[jPunten[i].STATDEV] = {
                              label: '',
                              punkt: [{
                              x: jPunten[i].KARTNR,
                              y: jPunten[i].BITNRK}]
  </code></pre>
  
  <p>Some Firebug output (i also noticed that in firebug the object IS ordered alphabetically):</p>
  
  <pre><code>racks
      []
  
  DAY
      Object { punkt=[8], label=""}
  
  label
      ""
  
  punkt
      [Object { x="12", y="1"}, Object { x="12", y="2"}, Object { x="12", y="3"}, 5 meer...]
  
  0
      Object { x="12", y="1"}
  
  1
      Object { x="12", y="2"}
  
  2
      Object { x="12", y="3"}
  
  3
      Object { x="12", y="4"}
  
  4
      Object { x="12", y="5"}
  
  5
      Object { x="12", y="6"}
  
  6
      Object { x="12", y="7"}
  
  7
      Object { x="12", y="8"}
  
  LSF01
      Object { punkt=[1], label=""}
  
  label
      ""
  
  punkt
      [Object { x="1", y="10"}]
  
  0
      Object { x="1", y="10"}
  
  x
      "1"
  
  y
      "10"
  </code></pre>