7stud -- wrote:
> arr1 = [1, 2, 3, 4, 5]
> arr2 = ["foo", "bar", "baz", "abc", "def"]
> 
> resultA = arr1.zip(arr2).flatten
>

This is probably more efficient:

resultA = []
arr1.zip(arr2) do |item_arr1, item_arr2|
  resultA << item_arr1 << item_arr2
end

Just remember: a bunch of methods chained together on one line is rarely 
very efficient.

-- 
Posted via http://www.ruby-forum.com/.