Ruby - Enumerable and Collection Processing
Find the error in this code:
arr = [5, 10, 15]
filtered = arr.reject { |x| x > 10 }
puts filteredarr = [5, 10, 15]
filtered = arr.reject { |x| x > 10 }
puts filteredx and condition x > 10, which is valid.puts on an array prints each element on a new line, which is expected.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions