Skip to main content

Function: arraySymmetricDiff()

arraySymmetricDiff<Item>(...arrays): Item[]

Defined in: functions/arraySymmetricDiff.ts:13

Computes the symmetric difference of multiple arrays.

Note: TypeScript automatically expects all other arrays to be same as the first one. If you get any type errors, try specifying the type explicitly or just use any. E.g. arraySymmetricDiff<any>(...)

Type Parameters

Item

Item = any

Parameters

arrays

...Item[][]

Arrays to compute the symmetric difference from.

Returns

Item[]

An array containing the symmetric difference of the input arrays.

Example

arraySymmetricDiff([1, 2], [2, 3], [3, 4]) // [1, 4]