asdf = [[1,2,3],[11,22,33,44,55,66],[51]]
def recursive(params, index)
if (index==params.size)
puts "DONE"
end
currentParam = params[index]
currentParam.each do |sh|
puts sh
recursive(params, index+1)
end
end
recursive(asdf,0)
I was expecting an output like:
1 11 22 33 44 55 66 51 2 11 22 33 44 55 66 51 3 11 22 33 44 55 66
Instead I get:
1 11 51
And:
Undefined method 'each' for nil:NilClass`