Options
All
  • Public
  • Public/Protected
  • All
Menu

Module flatMapDeep

Index

References

Functions Collection

References

Renames and re-exports flatMapDeep

Collection Functions

  • flatMapDeep<T, R>(collection: T[], iteratee?: Iteratee<number, T, T[]>): R[]
  • flatMapDeep<T, R>(collection: Record<string, T>, iteratee?: Iteratee<string, T, Record<string, T>>): R[]
  • This method is like flatMap except that it recursively flattens the mapped results.

    since

    5.4.0

    see

    flatMap,flatMapDepth,flatten,flattenDeep,flattenDepth,[[map]],mapKeys,mapValues

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

    flatMapDeep([1, 2], duplicate)
    // => [1, 1, 2, 2]

    Type parameters

    • T

    • R = any

    Parameters

    • collection: T[]

      The collection to iterate over.

    • Optional iteratee: Iteratee<number, T, T[]>

      The function invoked per iteration.

    Returns R[]

    Returns the new flattened array.

  • Type parameters

    • T

    • R = any

    Parameters

    • collection: Record<string, T>
    • Optional iteratee: Iteratee<string, T, Record<string, T>>

    Returns R[]