js-util

Home > rc-js-util > arrayUnion

arrayUnion() function

Given an ArrayLike of ArrayLike, provides all unique items in an Array.

Signature:

export declare function arrayUnion<TItem>(items: ArrayLike<ArrayLike<TItem>>, getComparisonValue?: (item: TItem, index: number) => unknown): TItem[];

Parameters

Parameter Type Description
items ArrayLike<ArrayLike<TItem>>  
getComparisonValue (item: TItem, index: number) => unknown (Optional)

Returns:

TItem[]

Remarks

See arrayUnion().