deepFlatten
Deep flattens an array.
- Use recursion.
- Use
Array.prototype.concat()
with an empty array ([]
) and the spread operator (...
) to flatten an array. - Recursively flatten each element that is an array.
Deep flattens an array.
Array.prototype.concat()
with an empty array ([]
) and the spread operator (...
) to flatten an array.