title: computed function ignores if else statement
body: <p>I have this computed function to filter my products, but it seems it just ignoring if else statement and when I move the return statement underneath the if else statement the if else statement is working but the return statement is not.</p>
  <p>Here is the code :</p>
  <pre><code>computed: {
                  filteredProducts: function() {
  
                      return this.products.filter((product) =&gt; {
                          return product.productName.toLowerCase().includes(this.keyword.toLowerCase());
                      });
  
                      var vm = this;
                      var category = vm.selectedCategory;
  
                      if(category.includes(&quot;All&quot;)) {
                          return vm.products;
                      } else {
                          return vm.products.filter((product) =&gt; {
                              var keys = Object.keys(product);
                              var matchFilter = false;
                              category.forEach((key) =&gt; {
                                  if(product[key] === true) {
                                      matchFilter = true;
                                  }
                              });
                              return matchFilter;
                          });             
                      }
  
                  },
  
              },
  </code></pre>