title: Typescript Error: Argument of type 'T' is not assignable to parameter of type 'number'?
body: <p>Can anyone tell me what typescript error here?  </p>
  
  <pre><code>public sortList&lt;T&gt;(data: T[], key: string, action: boolean): Observable&lt;T[]&gt; {
  
  const outputData: T[] =  data.sort((a, b) =&gt; {
    if (isNaN(a) &amp;&amp; isNaN(b)) {
      return a[key].toUpperCase() &gt; b[key].toUpperCase() ? 1 : a[key].toUpperCase() &lt; b[key].toUpperCase() ? -1 : 0;
    }
  });
  
  return of(outputData)
    .pipe(
      share()
    );
  }
  }
  </code></pre>
  
  <blockquote>
    <p>isNaN(a)
     and >isNaN(b) is throwing following error.</p>
  </blockquote>
  
  <pre><code>(parameter) b: T
  Argument of type 'T' is not assignable to parameter of type 'number'.ts(2345)
  </code></pre>