Created
January 4, 2013 17:56
-
-
Save icambridge/4454572 to your computer and use it in GitHub Desktop.
Shows that the variable created within the scope of the begin end isn't destoryed after the loop.
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
people = ['one','two','three','four'] | |
counter = 0; | |
begin | |
person = people[counter] | |
puts person | |
counter = counter + 1 | |
end while not people[counter].nil? | |
puts person |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created as a note to self
output
one
two
three
four
four