This method is like _.flatMap except that it recursively flattens the mapped results up to depth times.
_.flatMap
depth
The collection to iterate over.
Returns the new flattened array.
4.7.0
function duplicate(n) { return [[[n, n]]];}_.flatMapDepth([1, 2], duplicate, 2);// => [[1, 1], [2, 2]] Copy
function duplicate(n) { return [[[n, n]]];}_.flatMapDepth([1, 2], duplicate, 2);// => [[1, 1], [2, 2]]
Optional
_.flatMapDepth
This method is like
_.flatMap
except that it recursively flattens the mapped results up todepth
times.