Combine array of array into all possible combinations, forward only, in Ruby December 31, 2023 by Tarik Know your Array#product: a = [['1','2'],['a','b'],['x','y']] a.first.product(*a[1..-1]).map(&:join)