Function compactBy

  • Filters out elements for which the given properties are null or undefined. Elements that are null or undefined themselves are filtered out.

    Type Parameters

    • T

    • K extends string | number | symbol

    Parameters

    • array: (undefined | null | T)[]

      the array to filter

    • Rest ...props: K[]

      the properties by which to compact the array

    Returns RequireProps<NonNullable<T>, K>[]

Generated using TypeDoc