title: sort objects in array with dynamic keys
body: <p>I am trying to sort an array of dynamic key / values (Object) based on a property in the object. Can someone please provide me an example of how to do this. Ill try to create a similar structure to my issue</p>
  
  <p>Order Class:</p>
  
  <pre><code>export class order {
    id: number; 
    productRank: number; 
    productId: number; 
    productName: string;
  }
  </code></pre>
  
  <p>There is a storeOrders observable array of orders in my component</p>
  
  <pre><code>storeOrders$: Observable&lt;Array&lt;orders&gt;&gt;;
  </code></pre>
  
  <p>The key in the orders array is dynamically generated and is stored with the key/value containing  as key and order object as value</p>
  
  <p>then the orders object for example is something like: </p>
  
  <pre><code> let orders = {
  12_123: { id: 123, productRank: 3, productId: 23, productName: 'shirt'},
  23_124: { id: 124, productRank: 1, productId: 14, productName: 'cologne'},
  67_124: { id: 125, productRank: 2, productId: 45, productName: 'belt' }       
   }
  </code></pre>
  
  <p>When i subscribe to this data, how can I iterate over the storeOrders array and sort items based on the productRank. I have been trying to get this right but was not able to get this working, can someone please point out how to iterate over dynamic keys in an array and do a sort based on a property in the value object? Thank you, your helps really appreciated!   </p>