repeat

inline fun repeat(times: Int, action: (Int) -> Unit)(source)

Executes the given function action specified number of times.

A zero-based index of current iteration is passed as a parameter to action.

Since Kotlin

1.0

Samples