Loops/Foreach: Difference between revisions

(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag)
Line 1,521:
 
=={{header|J}}==
<syntaxhighlight lang="j">smoutput each echo every i.10</syntaxhighlight>
0
1
2
3
4
5
6
7
8
9</syntaxhighlight>
 
That said, J's <code>for.</code> provides a "foreach" mechanism.
 
<syntaxhighlight lang="J"> {{for_i. i. y do. echo i end.}}10
0
1
2
3
4
5
6
7
8
9
</syntaxhighlight>
 
=={{header|Java}}==
6,962

edits