title: Array.sort(compareFn) returns a number. Working Plunker demo returns boolean?
body: <p>Looking at this code:</p>
  
  <pre><code>class Customer {
    id: string;
    name: string;
  }
  
  private customers = [
    { id: '1234', name: 'Foo'},
    { id: '3241', name: 'Bar'}
  ]
  
  getCustomers(): Customer[] {
      return this.customers.sort((a,b) =&gt; {
          return a[name] &lt; b[name];
      });
  }
  </code></pre>
  
  <p>you would notice that <code>getCustomers()</code> <strong>returns a boolean</strong>, which is not allowed since it's being used as a compare function that <strong>expects a number</strong>. </p>
  
  <p>The code above would return an error: <code>Type 'boolean' is not assignable to type 'number'.</code> That's clear in the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" rel="nofollow noreferrer">MDN documentation</a></p>
  
  <p>However, this code snippet: <a href="https://plnkr.co/DITVzCSqHHB1uNrTxFit/" rel="nofollow noreferrer">https://plnkr.co/DITVzCSqHHB1uNrTxFit/</a>
  is from an Angular tutorial and works fine.
  Is there something different between the typescript or javascript used in Plunker vs other IDEs? (I'm using VSCode with Angular CLI)</p>