How do you add an array to another array in Ruby and not end up with a multi-dimensional result?
I tried: somearray = [“some”, “thing”] anotherarray = [“another”, “thing”] somearray.push(anotherarray.flatten!) I expected [“some”, “thing”, “another”, “thing”] but got [“some”, “thing”, nil] 18 s 18 You’ve got a workable idea, but the #flatten! is in the wrong place — it flattens its receiver, so you could use it to turn [1, 2, [‘foo’, ‘bar’]] into … Read more