Skip to content

Instantly share code, notes, and snippets.

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

What would you like to do?
queue = []
['hello', 'x', 'world'].each do |word|
queue << word and puts "Added to queue" unless word.length < 2
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.