simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

[micro-dash] Feature request: intersection() #48

Closed ersimont closed 3 years ago

ersimont commented 3 years ago

Naive implementation:

export function intersection<T>(array1: T[], array2: T[]): T[] {
  return Array.from(setIntersection(new Set(array1), new Set(array2)));
}