the reduce lesson begins by saying
reducecan be invoked in three ways:
- With one argument, a symbol that names a binary method or operator (e.g., :+, which takes two operands, or :lcm, which has a receiver and an argument).
- With a block and without an argument. The block has two parameters: an accumulator and the current element.
- With a block and with one argument that’s the initial accumulator. The block has two parameters: an accumulator and the current element.
I believe reduce can also take two arguments: the initial accumulator and a symbol.
.reduce(0, :+) #=> 0