Last active
December 30, 2015 20:49
-
-
Save dogweather/7883396 to your computer and use it in GitHub Desktop.
Iterate through an array, printing each element on a separate line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
an_array.each { |item| puts item } | |
# or | |
an_array.each do |item| | |
puts item | |
end | |
# or | |
for item in an_array | |
puts item | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment