Ruby - Enumerable and Collection Processing
What is the output of this Ruby code?
arr = [10, 15, 20, 25]
result = arr.reject { |x| x > 15 }
puts result.inspectarr = [10, 15, 20, 25]
result = arr.reject { |x| x > 15 }
puts result.inspectx > 15 is true, so elements greater than 15 are removed.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions