flatMapDepth

Collection
since 4.7.0

Returns

Array the new flattened array.

This method is like _.flatMap except that it recursively flattens the mapped results up to depth times.

Example of Lodash _.flatMapDepth

function duplicate(n) {
  return [[[n, n]]];
}

_.flatMapDepth([1, 2], duplicate, 2);
// => [[1, 1], [2, 2]]