union (Functional Programming) es-toolkit
Creates a function that combines two arrays without duplicate values. Use it with pipe.
Info
Usage
union returns unique values from the piped array followed by values from secondArray that have not appeared yet.
Parameters
secondArrayreadonly T[]required
The array to combine after the piped array.
Returns
A function that maps a readonly T[] to the union of both arrays.
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.