title: Typescript filter an array of objects
body: <p>I want to filter my <code>results</code> array based on the values stored in filters.
  I have tried the below code. But it is not applying.</p>
  
  <pre><code>let filters = {
    name: ["Krishna", "Naveen"],
    city : ["London"]
  };
  results = [
  {
      "name": "Krishna#Surname",
      "city": "London",
      "age": 23
  },
  {
      "name": "Naveen#Surname",
      "city": "London",
      "age": 23
  },
  {
      "name": "Krishna#Surname",
      "city": "NewYork",
      "age": 23
  },
  {
      "name": "Praveen#Surname",
      "city": "Washington",
      "age": 23
  }
  ]
  this.results1 = this.multiFilter(results,filters);
  
  multiFilter(array:any=[], filters:Object) {
  const filterKeys = Object.keys(filters);
  return array.filter((item) =&gt; {
    return filterKeys.every(key =&gt; {
      let filters1= filters[key];
      return filters1.every(key1 =&gt; {
        return !!~ item[key].indexOf(key1)
      });
    });
  });
  }
  </code></pre>