I'm trying to do some calculations and get the groups and departments array from there. but if I'm returning it like this [], [] It is giving error, while if I return it like [[],[]] it is working fine but in the later case, 3 arrays will get initialize which I want to avoid? Is there any better way to do it using 2 array itself?
def fetch_group_dept_values
if condition
[1,2,3,], [4,5]
else
[9,15], [10,11]
end
end
groups, departments = fetch_group_dept_values