for statement

The C# loop that repeats while a condition holds, with an initialiser and an update step, used when the index matters.

In more detail

for (var i = 0; i < orders.Length; i++) visits each position by number. Use foreach when you only need each item.

Related terms

Taught in

References