Home > rc-js-util > arrayCompactMap
Like _Array.map but where the callback returns null it will be omitted from the result.
Signature:
export declare function arrayCompactMap<TItem, TTransformed>(items: ArrayLike<TItem>, map: (item: TItem, index: number) => TTransformed | null): TTransformed[];
Parameter | Type | Description |
---|---|---|
items | ArrayLike<TItem> | |
map | (item: TItem, index: number) => TTransformed | null |
Returns:
TTransformed[]
See arrayCompactMap().