title: How to fix "Array.prototype.filter() expects a value to be returned at the end of arrow function"
body: <p>I'm having some issues understanding why I'm getting a warning on this piece of my React code</p>
  <blockquote>
  <p>Array.prototype.filter() expects a value to be returned at the end of arrow function</p>
  </blockquote>
  <p>but it seems to work.</p>
  <pre><code> {customers
      .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
      .filter((customer) =&gt; {
        if (searchTerm === &quot;&quot;) {
          return customer;
        } else if (
          customer.cust_main_name.toLowerCase().includes(searchTerm.toLowerCase())
        ) {
          return customer;
        }
      })
  </code></pre>
  <p>What changes do I need to implement to avoid this warning?</p>