• Return a copy of the collection with the null values removed

    Parameters

    • arr: any[]

    Returns any[]

    Function

    Example

    compact(["a", "b", null, "c"]) // => ["a", "b", "c"]