Ruby - Enumerable and Collection Processing
Identify the issue in this Ruby code snippet:
nums = [5, 10, 15]
result = nums.inject(0) { |total, n| total - n }
puts resultnums = [5, 10, 15]
result = nums.inject(0) { |total, n| total - n }
puts result15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions