Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
looping through an array of groceries in Ruby
groceries = ["apple", "pear", "banana"]
groceries.each do |grocery|
puts grocery
end
# =>
# apple
# pear
# banana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment