From: Nasir Khan Date: 2006-07-05T09:16:18+09:00 Subject: Parallel Array ------=_Part_9628_18870421.1152058575224 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline If I have two arrays a=[1,1,1,1] and b=[2,2,2,2] and I want to add each element up, something like - c = a plus b => [3,3,3,3] One way I could think up is - irb(main):010:0> (0...a.length).collect{|k| a[k]+b[k]} => [3, 3, 3, 3] Is there a better/faster way? Thanks Nasir ------=_Part_9628_18870421.1152058575224--