break, continue

break: statement jumps out of the current loop body;

If the loop is nested, the break statement will only cause the program flow to jump out of the innermost loop structure that contains it, and only jump out of one layer of loops.

Continue

The Continue statement is a supplement to the break statement. Continue does not jump out of the loop body immediately, but skips the statement before the end of the loop, returns to the loop condition test part, and restarts the execution loop.

After a continue is encountered in a for loop statement, the loop increment part is executed first, followed by the conditional test.

In the do.....while, while, continue statement is control directly back to the conditional test part.

Guess you like

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