Lua Break Statement
# Lua break Statement
[ Lua Loops](#)
The Lua programming language `break` statement is inserted within a loop body to exit the current loop or statement and begin executing the next statement in the script.
If you use nested loops, the `break` statement will stop the execution of the innermost loop and begin executing the statements of the outer loop.
### Syntax
The syntax for the `break` statement in the Lua programming language is:
break
Flowchart:

### Example
The following example executes a `while` loop, printing the value of `a` as long as the variable `a` is less than 20, and terminates the loop when `a` is greater than 15:
-- a = 10--while( a 15) then -- break endend
The result of executing the above code is as follows:
a's value is:10 a's value is:11 a's value is:12 a's value is:13 a's value is:14 a's value is:15
[ Lua Loops](#)
YouTip