6.10 break语句 The break statement

break_stmt  ::=  "break"
Download entire grammar as text.

break may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop.

break在句法上只能出现在for或while循环中, 但不能出现在循环中的函数定义或类定义中.

It terminates the nearest enclosing loop, skipping the optional else clause if the loop has one.

它中断最内层的循环, 跳过其可选的else语句(如果有的话).

If a for loop is terminated by break, the loop control target keeps its current value.

如果for循环被break中断, 它的循环控制对象还保持当前值,

When break passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the loop.

当break放在具有finally子句的try语句中, finally子句中的语句会在循环真正退出之前执行一次.