result.fold in kotlin code example Example: kotlin fold listOf(1, 2, 3).fold(0) { sum, element -> sum + element }