Ruby: How to concatenate array of arrays into one
You’re looking for #flatten: concatenated = array_of_arrays.flatten By default, this will flatten the lists recursively. #flatten accepts an optional argument to limit the recursion depth – the documentation lists examples to illustrate the difference.