Docs
chromia.com

Function

compactArray

  • compactArray<T>(elements: (T | null | undefined)[]): T[]

    Accepts an array which might be a mix of values and null/undefined and returns the same array without said null/undefined values.

    Type Parameters

    • T

    Parameters

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

      the array to compact

    Returns T[]