removeArrayWrappers(Recursively removes unnecessary array wrappers from a nested array structure. If an element in the array is itself an array with only one element, it replaces that element with its single value. If the element is a nested array with more than one element, the function is called recursively on that nested array.array
):any
[]
Parameter | Type | Description |
---|---|---|
array | any [] | The array to process, which may contain nested arrays. |
any
[]
A new array with unnecessary wrappers removed, where single-element arrays
are replaced by their single value.