Intermediate Ruby
Q48 / 100

What does "Array#inject" (also known as reduce) do?

Correct! Well done.

Incorrect.

The correct answer is B) Combines all elements into a single value by repeatedly applying a binary operation, carrying an accumulator

B

Correct Answer

Combines all elements into a single value by repeatedly applying a binary operation, carrying an accumulator

Explanation

inject (alias reduce) takes an optional initial value and a block, applying the block cumulatively to reduce the collection to a single result.

Progress
48/100