Skip to content

Instantly share code, notes, and snippets.

@iheartkode
Created May 27, 2015 07:01
Show Gist options
  • Save iheartkode/376e7635691b91038c00 to your computer and use it in GitHub Desktop.
Save iheartkode/376e7635691b91038c00 to your computer and use it in GitHub Desktop.
common loops in ruby
names = ["bob", "susan", "steve"]
# goes through each name in the array then makes a variable name and puts it to the screen
names.each do |name|
puts name
end
output:
bob
susan
steve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment