Kotlin: using lambdas and higher-order functions
Example:
val numbers = listOf(1, 2, 3, 4, 5)
Kotlin supports higher-order functions and lambdas.
Solution:
val doubled = numbers.map { it * 2 }
Example: Solution:Kotlin: using lambdas and higher-order functions
Kotlin supports higher-order functions and lambdas.
val numbers = listOf(1, 2, 3, 4, 5)
val doubled = numbers.map { it * 2 }