Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# first version
my_collection = SomeCollection.new
(1..10).each do |item|
value = "value number #{item + 1}"
my_collection.insert(value)
end
# second version
my_collection = SomeCollection.new
values = []
(1..10).each do |item|
value = "value number #{item + 1}"
values.push(value)
end
values.each { |v| my_collection.insert(v) }
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.