effect-io-ai

Package: effect
Module: Array

Array.difference

Computes elements in the first array that are not in the second, using Equal.equivalence().

When to use

Use when you need to keep values from the first array that are absent from the second and the default Equal.equivalence() comparison is appropriate.

Example (Computing array differences)

import { Array } from "effect"

console.log(Array.difference([1, 2, 3], [2, 3, 4])) // [1]

See

Signature

declare const difference: { <A>(that: Iterable<A>): (self: Iterable<A>) => Array<A>; <A>(self: Iterable<A>, that: Iterable<A>): Array<A>; }

Source

Since v2.0.0