3 ms·
Of all the syntaxes I've seen to do this, I like Kotlin's best: repeat(10) { println("Counter is $it") } Kotlin optimizes nicely for the most
by hota_mazi 5y ago
Of all the syntaxes I've seen to do this, I like Kotlin's best:
repeat(10) {
println("Counter is $it")
}
Kotlin optimizes nicely for the most default case while giving you flexibility if you need it (different parameter name, step, etc...).