Sobes.tech
Junior — Senior

What result will program №21 output

livecode

Task condition

let sumResult: Int = [1, 2, 3]
    .reduce(.zero) {
        $0 + $1
    }

print(sumResult)

This code fragment creates an array of three integers. Using the reduce function, all elements are summed starting from zero, and the resulting sum is printed to the console.