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

Parameter

Type

Description

a

T[] | any

first array

b

any[] | any

second array

**Returns:**

T[]

The intersection of the two arrays.