Summary
Loops repeat code until a condition changes. A
for_loop uses an initializer, test, and update. A
while_loop repeats while a boolean
condition is true. A
do_while_loop runs once, then checks the condition. The repeated code is the
loop_body. Each pass is an
iteration. Use
break to exit early. Use
continue to skip to the next iteration. Watch for an
infinite_loop when the condition never changes. Track counters or indexes with an
increment or
decrement.