title: TypeScript Sorting Object by Date
body: <p>I have this little code I borrowed from another question for sorting objects in an array by date. However, I can't figure out how to port this to TypeScript. </p>
  
  <pre><code>this.filteredTxs.sort(function(a,b): any{
          return new Date(b.date) - new Date(a.date);
  });
  </code></pre>
  
  <p>TS Error:</p>
  
  <blockquote>
    <p>ERROR in /transactions-view.component.ts(72,16): error TS2362: The
    left-hand side of an arithmetic operation must be of type 'any',
    'number' or an enum type.</p>
    
    <p>/transactions-view.component.ts(72,35): error TS2363: The right-hand
    side of an arithmetic operation must be of type 'any', 'number' or an
    enum type.</p>
  </blockquote>