Skip to main content

intersect() function

Compute the intersection of two arrays Elements are compared by reference so object types will appear as unique even if they contain the same data.

Signature:

export declare function intersect<T>(a: T[] | any, b: any[] | any): T[]

Parameters

ParameterTypeDescription
aT[] | anyfirst array
bany[] | anysecond array

Returns:

T[]

The intersection of the two arrays.