Answers for "kotlin reduce"

0

kotlin reduce

listOf(1, 2, 3).reduce { sum, element -> sum + element }	// 6

val strs = listOf("a", "b", "c", "d")
println(strs.reduce { acc, string -> acc + string }) 		// abcd
Posted by: Guest on April-21-2021

Browse Popular Code Answers by Language