title: vue javascript filter object typeError
body: <p>I want to filter an object by states-name (e.g. Berlin, Bayern ...). This is my response from the API.</p>
  <pre><code>  &quot;states&quot;:{
  
        &quot;Bayern&quot;:{
           &quot;total&quot;:13124737,
           &quot;rs&quot;:&quot;09&quot;,
           &quot;vaccinated&quot;:254916,
           &quot;vaccinated_by_accine&quot;:{
              &quot;biontech&quot;:246384,
              &quot;moderna&quot;:8532
           },
           &quot;difference_to_the_previous_day&quot;:4878,
           &quot;vaccinations_per_1000_inhabitants&quot;:19.42,
           &quot;quote&quot;:1.94,
           &quot;2nd_vaccination&quot;:{
              &quot;vaccinated&quot;:67418,
              &quot;difference_to_the_previous_day&quot;:8102
           }
        },
        &quot;Berlin&quot;:{
           &quot;total&quot;:3669491,
           &quot;rs&quot;:&quot;11&quot;,
           &quot;vaccinated&quot;:74605,
           &quot;vaccinated_by_accine&quot;:{
              &quot;biontech&quot;:73012,
              &quot;moderna&quot;:1593
           },
           &quot;difference_to_the_previous_day&quot;:3306,
           &quot;vaccinations_per_1000_inhabitants&quot;:20.33,
           &quot;quote&quot;:2.03,
           &quot;2nd_vaccination&quot;:{
              &quot;vaccinated&quot;:18158,
              &quot;difference_to_the_previous_day&quot;:953
           }
        },
  </code></pre>
  <p>This is my function in computed section:  (searchstring is an input-field in my markup)</p>
  <pre><code>computed: {    
  filteredList() {   
          let filter = {};
          let searchString = this.searchstring.toLowerCase();
      
          Object.keys(this.vacciResults).forEach(key =&gt; {
            filter[key] = this.vacciResults[key].filter(function(item){
              return item.toLowerCase().includes(searchString);
            });
          });
      
          return filter
      
        },
      ...
      this.vacciResults = res.states;
  </code></pre>
  <p>I get this error, why? item should contain the states name.</p>
  <p><a href="https://i.stack.imgur.com/BqSLO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BqSLO.png" alt="enter image description here" /></a></p>
  <p>new function:</p>
  <pre><code>   filteredList() {   
          
          let searchString = this.searchstring.toLowerCase();
      
          return Object.keys(this.vacciResults).reduce((carry, key) =&gt; {
              carry[key] = Object.keys(this.vacciResults[key]).filter(item =&gt; item.toLowerCase().includes(searchString))
            
              return carry
  
            }, {})
      
        },
  </code></pre>