title: How to return multiple values from a filter function?
body: <p>I am trying to return multiple values in typescript, implementing search filter.
  If am return separately works fine, but if am trying to return both it seems not working.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  @Pipe({ name: 'category' })
  
  export class CategoryPipe implements PipeTransform {
    transform(categories: any, searchText: any): any {
      if(searchText == null) return categories;
  
      return categories.filter(
        function(category){
         var a = category.DistrictName.toLowerCase().indexOf(searchText.toLowerCase()) &gt; -1;
         var b = category.Population.toLowerCase().indexOf(searchText.toLowerCase()) &gt; -1;
         return a;
         //return [a,b];
        }
      )
  
    }
  }
  </code></pre>