How do jquery $.each and for jump out of the loop to terminate the loop

How to terminate this loop or jump out of the loop in jquery? Check some information, and have tested and found that the following methods can be used 

1. We use continue in the for loop; terminating this loop is counted as the next loop, and use break to terminate the entire loop. 
2. In jquery, $.each uses return true and return false correspondingly. 

break can jump out of the switch...case statement and continue to execute the content after the switch statement. The break statement can also jump out of the loop, that is, end the execution of the loop statement. 

The function of the continue statement is to end the current loop, and then judge whether to execute the loop next time. 

The difference between continue and break is: break ends the loop completely, while continue ends the loop

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324585652&siteId=291194637