Loops/Foreach: Difference between revisions
Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag
Jazzedpineda (talk | contribs) (Added EasyLang implementation) |
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag) |
||
Line 1,096:
{
val vals = [10, 20, 30, 40];
console.
Loop: for (val val : vals)
{
console.
}
Map<String, Int> pairs = ["x"=42, "y"=69];
console.
for ((String key, Int val) : pairs)
{
console.
}
console.
Loop: for (String key : pairs)
{
console.
}
console.
for (Int n : 1..5)
{
console.
}
}
Line 1,123:
</syntaxhighlight>
{{out}}
<pre>
Array of values:
value #1: 10
Line 1,145:
4
5
</pre>
=={{header|Efene}}==
|