• Removes falsey values from the array

    Example

    compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]); // [ 1, 2, 3, 'a', 's', 34 ]
    

    Type Parameters

    • Value

    Parameters

    • array: Value[]

    Returns CompactT<Value>[]

Generated using TypeDoc