js-util

Home > rc-js-util > arrayCompact

arrayCompact() function

Strips null and undefined items from arrays (non mutative).

Signature:

export declare function arrayCompact<TItem>(items: ArrayLike<TItem | null | undefined>): TItem[];

Parameters

Parameter Type Description
items ArrayLike<TItem | null | undefined>  

Returns:

TItem[]

Remarks

See arrayCompact().