title: How to stop loop in cypress
body: <p>I have a loop checking 40 items.
  I want to stop my loop, when I am finding the first element, which > 0 
  This is my code </p>
  
  <p>var genArr = Array.from({ length: 40 }, (v, k) => k + 1); </p>
  
  <pre><code>cy.wrap(genArr).each((index) =&gt; {
      cy.get('.list-item').eq(index - 1).find('.number')
          .invoke('text')
          .then(text =&gt; {
              const pendingCount = text;
              cy.get('.list-item').eq(index - 1).click();
              cy.get('.list-table').find('.list-table-list-item')
                  .should('have.length', pendingCount);
              if (text &gt; 0) break
           });
      });
  </code></pre>
  
  <p>});</p>
  
  <p>But I have a syntax error. Help me pls, How can I break my loop</p>