title: Sort an array of objects in typescript?
body: <p>How do I sort an array of objects in TypeScript?</p>
  
  <p>Specifically, sort the array objects on one specific attribute, in this case <code>nome</code> ("name") or <code>cognome</code> ("surname")?</p>
  
  <pre><code>/* Object Class*/
  export class Test{
       nome:String;
       cognome:String;
  }
  
  /* Generic Component.ts*/
  tests:Test[];
  test1:Test;
  test2:Test;
  
  this.test1.nome='Andrea';
  this.test2.nome='Marizo';
  this.test1.cognome='Rossi';
  this.test2.cognome='Verdi';
  
  this.tests.push(this.test2);
  this.tests.push(this.test1);
  </code></pre>
  
  <p>thx!</p>