difference (Functional Programming) es-toolkit
Creates a function that excludes values found in another array. Use it with pipe.
Info
Prefer the original es-toolkit difference in ordinary code. Use this fp variant when composing transformations with pipe.
Usage
difference keeps values from the piped array that are not present in secondArray. It preserves the order of the piped array.
Parameters
secondArrayreadonly T[]required
The array containing values to exclude.
Returns
A function that maps a readonly T[] to values not found in secondArray.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.