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

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T | ListOfRecursiveArraysOrValues<T>> | NumericDictionary<T | ListOfRecursiveArraysOrValues<T>>

      The collection to iterate over.

    Returns T[]

    Returns the new flattened array.

    Since

    4.7.0

    Example

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

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

    • T

    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • iteratee: ListIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>
    • Optional depth: number

    Returns TResult[]

    See

    _.flatMapDepth

  • Type Parameters

    • T extends object

    • TResult

    Parameters

    • collection: undefined | null | T
    • iteratee: ObjectIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>
    • Optional depth: number

    Returns TResult[]

    See

    _.flatMapDepth

  • Parameters

    • collection: undefined | null | object
    • iteratee: string
    • Optional depth: number

    Returns any[]

    See

    _.flatMapDepth

  • Parameters

    • collection: undefined | null | object
    • iteratee: object
    • Optional depth: number

    Returns boolean[]

    See

    _.flatMapDepth

Generated using TypeDoc