/** * Creates an `ImmutableArray` of unique values that are included in the * given arrays using the specified `Equivalence` for equality comparisons. * The order and references of result values are determined by the first array. * * @tsplus static ImmutableArray.Aspects intersection * @tsplus pipeable ImmutableArray intersection */ export function intersection(E: Equivalence, that: ImmutableArray) { return (self: ImmutableArray): ImmutableArray => self.filter((a) => that.elem(E, a)) }