D
Daniel Talsky
How come this works:
collection_of_objects = []
10.times do
collection_of_objects << MyObject.create
end
But this doesn't:
collection_of_objects = []
10.times do { collection_of_objects << MyObject.create }
I didn't understand there was ANY difference between the two syntaxes
really. Can someone explain to me the finer points?
collection_of_objects = []
10.times do
collection_of_objects << MyObject.create
end
But this doesn't:
collection_of_objects = []
10.times do { collection_of_objects << MyObject.create }
I didn't understand there was ANY difference between the two syntaxes
really. Can someone explain to me the finer points?