Kotlin - Collections Fundamentals
Identify the error in this Kotlin code snippet:
val numbers = listOf(4, 5, 6) numbers.forEach(println(it))
val numbers = listOf(4, 5, 6) numbers.forEach(println(it))
forEach(println(it)), which is invalid because println(it) is a function call, not a lambda.forEach { println(it) } with braces enclosing the lambda.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions