Answers for "kotlin let"

2

kotlin loop

val school = arrayOf("shark", "salmon", "minnow")
for (element in school) {
    print(element + " ")
}
-> shark salmon minnow

for ((index, element) in school.withIndex()) {
    println("Item at $index is $elementn")
}
-> Item at 0 is shark
Item at 1 is salmon
Item at 2 is minnow
Posted by: Guest on June-16-2020
1

kotlin scope functions

| object  lambda
-----+----------------
this | apply    run
it   | also     let
Posted by: Guest on January-31-2021

Browse Popular Code Answers by Language