Foreach |
For each (or foreach) is a computer language idiom for traversing items in a collection. Foreach is usually used in place of a standard for loop. Unlike this for loop construct however, a foreach loop usually does not specify the order in which the items are considered.
In Pseudocode, a foreach loop uses syntax similar to
foreach object-type object-name in collection-of-objects DoSomething( object-name )
Languages with foreach loops: *C Sharp programming language *Java 1.5 *Perl *Visual Basic *PHP *Python_programming_language *Smalltalk do: *JavaScript s Javascript#For_..._in_loop loop can be used in a similar manner to a foreach loop|
|
