Ruby - Blocks, Procs, and Lambdas
Given this code, what will be the output?
pairs = [[1, 2], [3, 4], [5, 6]] pairs.each do |a, b| puts a + b end
Given this code, what will be the output?
pairs = [[1, 2], [3, 4], [5, 6]] pairs.each do |a, b| puts a + b end
a and b receive each inner array's two elements separately.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions