-
-
Notifications
You must be signed in to change notification settings - Fork 9
Break Statement
IsaacShelton edited this page Mar 21, 2022
·
1 revision
The break
keyword is used to jump out of a loop
for(i usize = 0; i < 5; i++){
if i == 3, break
print(i)
}
0
1
2
A specific loop can be specified using loop labels
for outer_loop : (i usize = 0; i < 10; i++){
each Animal in animal_catagories[i] {
if it.isDead(), break outer_loop
}
}