array = [1, 2, 3, 4, 5, 6]
array.each { |x| puts x }
Do we have any other way to iterate?
array = [1, 2, 3, 4, 5, 6]
array.each { |x| puts x }
Do we have any other way to iterate?
Why are you asking this?
The enumerator module is very useful, but also see loops in documentation:
for x in array
puts x
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs