A command that immediately exits a loop, regardless of its condition.
Details
The break statement is useful when you want to stop a loop early.
🤖 Pseudocode
while playerIsAlive
if playerQuits
exit game
run game logic
After break, the program continues with the first statement after the loop.
Related Concepts
- Is: Jump Statement
Related Actions
- Used in: Break a While Loop