Does Kotlin have a way of letting you do something...
# getting-started
d
Does Kotlin have a way of letting you do something like:
Copy code
for (i in (1..10)) {
    // do stuff
    someFunc() // inside someFunc call continue to skip below part
    // do other stuff
}
r
That would be a really bad idea. You should do as @karelpeeters said and return a value. Commonly people use a
Boolean
so they can do
Copy code
for (i in 1..10) {
    // do stuff
    if (someFunc()) {
        // do other stuff
    }
}
c
Also,
repeat(10)
is shorter 🙂
âž• 3