2023-02-16 Reduceの小技 Swift let a = [1, 2, 3] let sum = a.reduce(0) { $0 + $1 } は更に簡略できます: let a = [1, 2, 3] let sum = a.reduce(0, +)