Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubyEnumerable and custom eachSingle-choice MCQ

What does `each_with_object` return here, and how does it differ from `inject`/`reduce` in this case?

result = [1, 2, 3].each_with_object([]) do |n, acc| acc << n * n n * 100 end p result