Ordering in javascript
<p>How easy/hard is it to order collections in javascript (alphabetical and numerically).</p>

<p>Say I have a collection like:</p>

<pre><code>var map = {

    user: { id: "23434", username: "mrblah" },
    user: { id: "1010", username: "johnskeet" }

};
</code></pre>

<p>And I want to order the collection by id and username.</p>

<p><b>Update</b>
correction thanks:</p>

<pre><code>var map = [ { id: "23434", username: "mrblah" }, { id: "1010", username: "johnskeet" } ];
</code></pre>
