mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
17 lines
357 B
Kotlin
Vendored
17 lines
357 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
|
|
val arr = arrayOf("a", "b", "c", "d")
|
|
|
|
fun box(): String {
|
|
val s = StringBuilder()
|
|
|
|
for ((index, x) in arr.withIndex()) {
|
|
if (index == 0) continue
|
|
if (index == 3) break
|
|
s.append("$index:$x;")
|
|
}
|
|
|
|
val ss = s.toString()
|
|
return if (ss == "1:b;2:c;") "OK" else "fail: '$ss'"
|
|
} |