Logo

Programming-Idioms

History of Idiom 2 > diff from v97 to v98

Edit summary for version 98 by dector:
New Kotlin implementation by user [dector]

Version 97

2019-09-27, 20:04:38

Version 98

2019-09-28, 21:49:56

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Code
repeat(10) {
    println("Hello")
}
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/repeat.html
Demo URL
https://pl.kotl.in/HCyRUAWU0