break statement and continue statement
##break statement
- Description: break statement, used to unconditionally end various loops (exit the loop) and switch.
- Note: Generally, you need to add a conditional judgment before the break statement. In other words: when the condition is established, the loop exits.
##continue statement
Note: Observe the results first, then comment out break, use continue instead, and observe the results again. It can be seen that when the conditions are met, break will jump out of the loop directly. When the loop operation is performed again, and continue is used instead, the condition is met, the current loop is jumped out, and the next loop is entered.
Next Section