repeat
Executes the given function action specified number of times.
inline fun repeat(times: Int, action: (Int) -> Unit)(source)
fun main() {
// Print numbers 0 to 4
repeat(5) { index ->
println("Current index: $index")
}
}
Executes the given function action specified number of times.
inline fun repeat(times: Int, action: (Int) -> Unit)(source)
fun main() {
// Print numbers 0 to 4
repeat(5) { index ->
println("Current index: $index")
}
}