title: How to sort object array based on key in typescript
body: <p>I have a candidate object with properties </p>
  
  <pre><code>candidateid:number;
  name:string;
  </code></pre>
  
  <p>I wish to sort an array of such objects based on the <code>name</code> property. How can I achieve this in TypeScript in angular 2?</p>