问题 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 var genArr = Array.from({ length: 40 }, (v, k) => k + 1); cy.wrap(genArr).each((index) => { cy.get('.list-item').eq(index - 1).find('.number') .invoke('text') .then(text => { 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 > 0) break }); }); }); But I