I have these arras
names = ["Will","Bob","John","Ben"]
ages = [45,49,32,49]
postcodes = [9320,3991,1234,2993]
Whats the most efficient way to stack them so they appear as
people = [["Will",45,9320],["Bob",49,3991],["John",32,1234],["Ben",49,2993]]
Does ruby have a function to merge these vertically? (by index) nice and simple without all those nasty loops?
1 Answer