title: How to sort an array of objects in ascending order of number?
body: <p>I have an array of objects like the following :</p>
  
  <pre><code>var array = {
      "112" : {
               "id": "3",
               "name": "raj"
      },
      "334" : {
               "id": "2",
               "name": "john"
      },
      "222" : {
               "id": "5",
               "name": "kelvin"
      }
  }
  </code></pre>
  
  <p>Now i want to sort the array in ascending order of <code>id</code> and then restore it in array. I tried using <code>sort()</code> but could not do it. Please help how to do so that when i display the data from the array it comes sorted.</p>