js-util

Home > rc-js-util > arrayIntersect

arrayIntersect() function

Given two ArrayLike, provides the items common between them in an Array.

Signature:

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

Parameters

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

Returns:

TItem[]

Remarks

See arrayIntersect().