Ruby - Enumerable and Collection Processing
Find and fix the error in this code snippet:
arr1 = [1, 2]
arr2 = ["a", "b"]
result = arr1.zip arr2
puts result.join(', ')arr1 = [1, 2]
arr2 = ["a", "b"]
result = arr1.zip arr2
puts result.join(', ')zipjoin on nested arraysjoin on nested arrays without converting inner arrays to strings causes error.result.map(&:join).join(', ') to join inner arrays first.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions