Anonymous user
Loops/Foreach: Difference between revisions
m
→{{header|Elena}}
m (→{{header|Wren}}: Changed to Wren S/H) |
imported>Arakov |
||
Line 1,220:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'routines;
import extensions;
Line 1,228:
var things := new string[]{"Apple", "Banana", "Coconut"};
things.forEach::(thing)
{
console.printLine
}
}</syntaxhighlight>
=== Using foreach statement template ===
<syntaxhighlight lang="elena">import extensions;
public program()
{
var things := new string[]{"Apple", "Banana", "Coconut"};
foreach(var thing; in things)
{
console.printLine(thing)
}
}</syntaxhighlight>
|