I have an array that takes in a set of values. At a certain index in the array, the value is an array. So it looks like this
[1, 2, 3, [4, 5]]
I'm trying to change the array value to be like this
[1, 2, 3, 4, 5]
How would you go back about doing this in Swift?
Here is how I get the result
let array = [value1, value2, [value3, value4]].compactMap{$0}