Hexa
11/10/2018, 5:41 PMk()
and when not to use it. val fruits = listOf("apple", "aabb", "ab", "apricot", "banana", "blueberry", "cherry", "coconut")
val evenFruits = fruits.k()
.fold(listOf<String>()) { acc, e -> if (e.length % 2 == 0) acc + e else acc }
val evenFruits2 = fruits
.fold(listOf<String>()) { acc, e -> if (e.length % 2 == 0) acc + e else acc }
println(evenFruits)
println(evenFruits2)
Shawn
11/10/2018, 5:49 PM.k()
supposed to be?