Package: effect
Module: Array
Computes the intersection of two arrays using Equal.equivalence(). Order is
determined by the first array.
When to use
Use when Effect equality is the right membership test and you want to keep values present in both inputs while preserving the first input’s order.
Example (Computing array intersections)
import { Array } from "effect"
console.log(Array.intersection([1, 2, 3], [3, 4, 1])) // [1, 3]
See
intersectionWith — use custom equalityunion — elements in either arraydifference — elements only in the first arraySignature
declare const intersection: { <B>(that: Iterable<B>): <A>(self: Iterable<A>) => Array<A & B>; <A, B>(self: Iterable<A>, that: Iterable<B>): Array<A & B>; }
Since v2.0.0