flattenDeep source npm

_.flattenDeep(array)

This method is like _.flatten except that it recursively flattens array.

Arguments

  1. array (Array)

    The array to recursively flatten.

Returns (Array)

Returns the new flattened array.

Example

_.flattenDeep([1, [2, 3, [4]]]);
// => [1, 2, 3, 4]