title: TypeScript sort by date not working
body: <p>I have an object <code>TaskItemVO</code> with field <code>dueDate</code> which has the type <code>Date</code>:</p>
  <pre><code>export class TaskItemVO {
      
      public dueDate: Date;
  }
  </code></pre>
  <p>I have this method which I call when I try to sort by date but it is not working:</p>
  <pre><code>public sortByDueDate(): void {
      this.myArray.sort((a: TaskItemVO, b: TaskItemVO) =&gt; {
          return a.dueDate - b.dueDate;
  
      });
  }
  </code></pre>
  <p>I get this error in the return line of method:</p>
  <blockquote>
  <p>The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.</p>
  <p>The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.</p>
  </blockquote>
  <p><strong>So what is the correct way of sorting array by date fields in TypeScript?</strong></p>