Vidyalelo
Ruby Programming · Q7

Enumerators and Iterators in Ruby

Programming · Ruby Programming · question 7

Q7

What is the purpose of the reduce method in Ruby enumerators?

A.
To sort elements in a collection
B.
To map elements to a new collection
C.
To combine all elements in a collection into a single value
Answer
D.
To filter elements in a collection

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board