From: James Edward Gray II Date: 2006-01-20T23:14:16+09:00 Subject: Re: Array#each - getting each element and the index On Jan 20, 2006, at 8:08 AM, Pat Maddox wrote: > Is there a way to get each element of an array, as well the index of > that element? You bet. > Something like > a = %w[foo bar] > a.each { |val, index| .... } # val => 'foo', index => 0 a.each_with_index ... James Edward Gray II