Logo

Programming-Idioms

History of Idiom 2 > diff from v78 to v79

Edit summary for version 79 by jtang:
[Kotlin] Updating explination

Version 78

2019-09-26, 17:27:09

Version 79

2019-09-26, 17:29:26

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
for( i in 0..9 ){
    println("Hello")
}
Code
for( i in 0..9 ){
    println("Hello")
}
Comments bubble
0..9 is inclusive
Doc URL
https://www.programiz.com/kotlin-programming/for-loop
Doc URL
https://www.programiz.com/kotlin-programming/for-loop