Skip to main content
**More Information**

So following C#, Kotlin has Lambda support with the change if => becoming -> and the Koan starts with some nice examples at the start:

fun example() {
val sum = { x: Int, y: Int -> x + y }
val square: (Int) -> Int = { x -> x * x }

sum(1, square(2)) == 5

}

Basically, though, the code that needs to be done is to check a collection if all items are even, which is easily done with:

fun task4(collection: Collection): Boolean = collection.any({item -> item % 2 == 0})