DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Iterate Two Arrays Simultaneously In Ruby

04.17.2012
| 4882 views |
  • submit to reddit
        // Iterate two arrays simultaneously in Ruby

array1.zip(array2).each do |v1, v2|
  # iterates over array1 and array2
end