title: How to optimize multiple filter?
body: <p>I have big search panel with filters
  <a href="https://i.stack.imgur.com/rqZW6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rqZW6.jpg" alt="search panel"></a>
  In the computed section I use the next code</p>
  
  <pre><code>computed: {
      filteredItems() {
        if (this.activeFilter &amp;&amp; this.activeFilter != 'all') {
          return this.items[this.activeFilter]
            .filter(item =&gt; item.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1)
            .filter(item =&gt; item.itemLevel &gt;= this.minLvl &amp;&amp; item.itemLevel &lt;= this.maxLvl);
        } else {
          let all = [];
          let i;
          if (this.items) {
            for (i = 0; i &lt; this.filters.length; i++) {
              Array.prototype.push.apply(all, this.items[this.filters[i].value]);
            }
          }
          return all
            .filter(item =&gt; item.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1)
            .filter(item =&gt; {
              if (this.minLvl !== '' &amp;&amp; this.maxLvl !== '') {
                if (item.itemLevel &gt;= this.minLvl &amp;&amp; item.itemLevel &lt;= this.maxLvl) return true;
              } else if (this.minLvl == '' &amp;&amp; this.maxLvl !== '') {
                if (item.itemLevel &lt;= this.maxLvl) return true;
              } else if (this.minLvl !== '' &amp;&amp; this.maxLvl == '') {
                if (item.itemLevel &gt;= this.minLvl) return true;
              } else {
                return true;
              }
            });
        }
      },
    } 
  </code></pre>
  
  <p>Here is I use one filter for min and max level. And when I will add more filter my code will be too big. Multiple filters can be active l at the same time.
  How can I optimize my code?</p>