title: How to assign an IF statement inside a map function
body: <p>I am trying to assign an IF statement inside a map function but it asks for a return. If I put the return, in front of the IF, does not work. Currently getting the following error on Lint: <em>Line 78:52:  Array.prototype.map() expects a return value from arrow function  array-callback-return</em></p>
  <p>I expect just to push objects into the array.</p>
  <p>What is the correct way to assign the IF inside a map?</p>
  <pre><code>     { ingredientIndex.map((currentIndex) =&gt; {
          const ingredient = detail[`strIngredient${currentIndex}`];
          const measure = detail[`strMeasure${currentIndex}`];
          if (ingredient) {
            validIngredients.push(`${ingredient} - ${measure}`);
          }
        }) }
  </code></pre>