clean-jsdoc-theme TypeDoc APIv0.0.0

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 array
  • b (T[]) — Second array

Returns

  • T[] — Array of elements present in both arrays

Example

CODE
intersection([1, 2, 3], [2, 3, 4]) // [2, 3]