Loops/Foreach: Difference between revisions

m
m (→‎{{header|Wren}}: Changed to Wren S/H)
imported>Arakov
Line 1,220:
 
=={{header|Elena}}==
ELENA 56.0x :
<syntaxhighlight lang="elena">import system'routines;
import extensions;
Line 1,228:
var things := new string[]{"Apple", "Banana", "Coconut"};
things.forEach::(thing)
{
console.printLine:(thing)
}
}</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>
Anonymous user