Exit the loop
Break
function
When encountering a break in the loop, it will jump out of the entire loop code block and
will not continue to the next loop.
Example
In the loop, if the break keyword appears, the
code will jump out of the loop body.
Skip the loop
continue
function
skip this round of loop, the next round of loop will continue
summary
break
Jump out of the entire loop, the interpreter will execute the code behind the loop body
continue
Skip the current cycle and continue to the next cycle