Array flattening
suggest changeGiven a multidimensional array:
my_array = [[1, 2], ['a', 'b']]
the operation of flattening is to decompose all array children into the root array:
my_array.flatten
# [1, 2, 'a', 'b']
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents