Ruby - Blocks, Procs, and Lambdas
Consider this code:
What is the output?
def transform(arr)
arr.map { |x| yield x * 2 }
end
result = transform([1, 2, 3]) { |n| n + 1 }
puts result.inspectWhat is the output?
