title: Javascript. Sorting array of objects by property x
body: <p>I want to draw objects one by one sorted by y value, so objects that are "closer" won't be drawn behind objects that have lower y. I have array like this:</p>
  
  <pre><code> List.list = [
   'idofobject' : {
    x: 20,
    y: 28
   },
   'otheridofobject' : {
    x: 20,
    y: 23
   },
  
  ];
  </code></pre>
  
  <p>How can i sort it by object y value? I tried to sort it like normal array of objects, but in this case i have id of object before properties, so it wasnt possible. How can i do this without deleting id of object? </p>