This method is like flatMap except that it recursively flattens the mapped results.
flatMap
The function invoked per iteration.
Returns the new flattened array.
4.7.0
flatMap, flatMapDepth, flatten, flattenDeep, flattenDepth, map, mapKeys, mapValues
function duplicate(n) { return [[[n, n]]]}flatMapDeep([1, 2], duplicate)// => [1, 1, 2, 2] Copy
function duplicate(n) { return [[[n, n]]]}flatMapDeep([1, 2], duplicate)// => [1, 1, 2, 2]
This method is like
flatMap
except that it recursively flattens the mapped results.