Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Latest commit

 

History

History
24 lines (17 loc) · 409 Bytes

File metadata and controls

24 lines (17 loc) · 409 Bytes

intersection

Finds common elements between both arrays.

Type signature

<T>(xs: T[], ys: T[]) => T[]

Examples

intersection([1, 2, 3, 4, 5], [5, 5, 3, 2]);
// ⇒ [2, 3, 5]

Questions

  • How to find common elements present in both arrays?