• Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<
          | undefined
          | null
          | false
          | ""
          | 0
          | T>

      The array to compact.

    Returns T[]

    Returns the new array of filtered values.