Anonymous user
Loops/Continue: Difference between revisions
m
→{{header|Scala}}: -Category:Scala Implementations
m ({{Out}} / moved Category to top) |
|||
Line 1,251:
=={{header|Scala}}==
Scala doesn't have a <code>continue</code> keyword.
===The intuitive way===
<lang scala>for (i <- 1 to 10) {
Line 1,258 ⟶ 1,259:
if (i % 5 == 0) println() else print(", ")
}</lang>
===Functional solution===
Thinking In Scala<sup>©</sup> says: we avoid for loops and handle it the [[functional_programming|Functional]] way:
|