title: Vue JS if/else statment inside computed property
body: <p>I'm trying to do an if / else statement inside a computed property for Vue JS for a search, this is what I've got and it's not working, how could I adapt this to work?</p>
  
  <pre><code>computed: {
      filteredProperties: function(){
        return this.properties.filter((property) =&gt; {
          return property.address.match(this.searchAddress) &amp;&amp;
  
          if (this.searchType.length &gt; 1) {
            this.searchType.some(function(val){
              return property.type.match(val)
            }) &amp;&amp;
          } else {
            property.type.match(this.searchType) &amp;&amp;
          }
  
          property.bedrooms.match(this.searchBedrooms) &amp;&amp;
          property.county.match(this.searchCounty)
        });
      }
    }
  </code></pre>