Iteration

Iteration is the process of repeating a set of steps, typically going through each item in a collection one at a time. Each pass through a loop is one iteration.

General Programming

Examples

Python

for fruit in ["apple", "pear"]:
    print(fruit)

Output:

apple
pear

JavaScript

for (const fruit of ["apple", "pear"]) {
  console.log(fruit);
}

Output:

apple
pear

See also

Back to the Dictionary