Answer the question
In order to leave comments, you need to log in
How to collect and return an array in ruby?
Hello. How can this be rewritten better? (remove array variables)
I'm sorry, gentlemen. Asked the wrong question.
def foo
array ||= []
@array_datas.each do |array_data|
array_data.each do |data|
array << data + 1
end
end
array
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question