Created
November 17, 2014 22:16
-
-
Save anonymous/c516537eaa10536cf01f to your computer and use it in GitHub Desktop.
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
number_array = [1, 2, 3] | |
#take each member of number_array and do something with it | |
# by storing it in the 'number' variable | |
number_array.each do |number| | |
puts number | |
end | |
#so that is the same as | |
number = number_array[0] | |
puts number | |
number = number_array[1] | |
puts number | |
number = number_array[2] | |
puts number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment