Skip to content

Instantly share code, notes, and snippets.

@mbriggs mbriggs/gist:177268
Created Aug 28, 2009

Embed
What would you like to do?
queue = []
['hello', 'x', 'world'].each do |word|
queue << word and puts "Added to queue" unless word.length < 2
end
puts queue.inspect
# Output:
# Added to queue
# Added to queue
# ["hello", "world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.