title: Typescript sorting array with objects on multiple properties
body: <p>I like to sort an array with objects that have multiple properties. My objects have a string called name and a boolean called mandatory.</p>
  
  <p>First i want to sort on age, next on the name.</p>
  
  <p>How do I do this?</p>
  
  <p>Ordering by age is easy...:</p>
  
  <pre><code>this.model.mylist.sort((obj1: IObj, obj2: IObj =&gt; {
      if (obj1.age &lt; obj2.age) {
          return -1;
      }
      if (obj1.age &gt; obj2.age) {
          return 1;
      }
      return 0;
  });
  </code></pre>