mathjs/docs/reference/functions/setSymDifference.md
2022-03-01 13:04:09 +01:00

1.5 KiB

layout
default

Function setSymDifference #

Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.

Syntax #

math.setSymDifference(set1, set2)

Parameters #

Parameter Type Description
a1 Array | Matrix A (multi)set
a2 Array | Matrix A (multi)set

Returns #

Type Description
Array | Matrix The symmetric difference of two (multi)sets

Throws #

Type Description

Examples #

math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])            // returns [1, 2, 5, 6]
math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])    // returns [1, 2, 5, 6]

See also #

setUnion, setIntersect, setDifference