Ruby - Enumerable and Collection Processing
Identify the problem in this code:
arr = [1, 2, 3]
result = arr.inject(0) { |sum, n| sum * n }
puts resultarr = [1, 2, 3]
result = arr.inject(0) { |sum, n| sum * n }
puts result15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions