intersection
intersection<T>(a: T[], b: T[]): T[]Source: array.ts:164
Finds the intersection of two arrays
Type Parameters
T— Array element type
Parameters
a(T[]) — First arrayb(T[]) — Second array
Returns
T[]— Array of elements present in both arrays
Example
CODE
intersection([1, 2, 3], [2, 3, 4]) // [2, 3]