title: Break For Each Loop in a Custom Cypress Command
body: <p>I have a custom Cypress command to scroll through a list until you reach the item passed into the command. In my command I have <code>$.each</code> so I can compare the name of the item to the item name passed into the function. If they match then I send a click command which is &quot;ENTER&quot; in my environment.
  I am able to successful scroll through the list and find the the item I am looking for and click on it but the loop continues to execute. I added <code>return false</code> which is what Cypress says should break the loop but it is now working for me. Any ideas why that is the case?</p>
  <pre><code>listItems.getChildren('OneLineTextElement', 'type').each(($elm) =&gt; {
      let labelAndValue = cy.wrap($elm).getChildren('LabelAndValue')
      let label = labelAndValue.getChild('Label')
      label.getProperty('texture-text').then(val =&gt; {
          if (val == subject) {
              cy.action('ENTER')
              return false
          }
          else {
              cy.action('DOWN')
          }
      })
  })
  </code></pre>