An iteration is the repetition of a sequence of statements either
A specified number of times
Until a condition is met
Four iteration statements are available:
The do ... while statement
The while statement
The for statement
The for ... in statement
Each of these statements performs a slightly different task, but each is a useful statement to learn how to use.
The do ... while statement runs a statement or a block of statements and then repeats the whole process until the condition expression is false. An example will clarify this:
The previous code has a variable, ...