Function icompact

  • Creates a new generator that filters all falsy and empty values from iterable.

    Returns

    A new array with the filtered values.

    Example

    compact([0, 1, false, 2, '', 3])
    // [1, 2, 3]

    Type Parameters

    • T

    Parameters

    • iterable: Iterable<T>

    Returns Generator<T, void, unknown>

Generated using TypeDoc