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