Combining two arrays to create a two dimensional array in ruby

Viewed 4763
a = [1, 2, 3]
b = [4, 5, 6]

How would I combine the two arrays in a 2D array?:

[[1, 4], [2, 5], [3, 6]]
2 Answers
Related