This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Looping Constructs
Looping is a core concept in programming. Mathematica provides powerful primitives for specifying and controlling looping, not only in traditional procedural programming, but also in other, more modern and streamlined programming paradigms.
Do evaluate an expression looping over a variable: Do
While evaluate an expression while a criterion is true: While
For a "for loop": For
Table build up a table by looping over variables: Table
Nest  ▪ NestWhile  ▪ FixedPoint  ▪ Fold  ▪ ...
Scan  ▪ Map(/@ ▪ MapIndexed  ▪ ReplaceRepeated(//. ▪ ...
Loop Termination
Throw exit any loop, going to the nearest enclosing Catch
Break  ▪ Continue  ▪ Return  ▪ Interrupt  ▪ Abort