Array flattening
suggest changeGiven a multidimensional array:
my_array = [[1, 2], ['a', 'b']]
Flattening pulls the elements of nested arrays into the outer array:
my_array.flatten
# [1, 2, 'a', 'b']
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents