Loop
Aloop is a sequence of instructions that is repeated until a certain condition is met. An example would be the process of getting an item of data and changing it, and then making sure somecondition is checked — such as if a counter has reached a prescribed number.
Loops are one way to execute a statement for a variable number of times. The same effect can be achieved withrecursion, especially in languages where all data isimmutable, making it impossible to update a counter variable.
In this article
See also
- Control flow on Wikipedia
- Loops and iteration guide