Loops/Continue: Difference between revisions
Content added Content deleted
(PowerShell) |
(add JavaScript) |
||
Line 245: | Line 245: | ||
} |
} |
||
System.out.print(", "); |
System.out.print(", "); |
||
}</lang> |
|||
=={{header|JavaScript}}== |
|||
Using the <code>print()</code> function from [[Rhino]]. |
|||
<lang javascript>var output = ""; |
|||
for (var i = 1; i <= 10; i++) { |
|||
output += i; |
|||
if (i % 5 == 0) { |
|||
print(output); |
|||
output = ""; |
|||
continue; |
|||
} |
|||
output += ", "; |
|||
}</lang> |
}</lang> |
||