[Kotlin] Named loop
It is possible to give loop a name, it is useful when dealing with nested loop:
fun main() { outer@ for (i in 1..10) { for (j in 1..10) { if (i - j == 5) { break@outer } println("$i - $j") } } }
Normally "break", only skip the inner for loop, when we give a name for the outer loop, and say break@outer, so it will skip outer for loop instead of inner one