symmetricDifference(values)

Returns the set of values that are only in one of these sets.

The given values may be any iterable.

The returned set will be the same type of this set, for any kind of set that inherits GenericSet.

On collections

Usage

  • symmetricDifference(values)

Example

var set = new SortedSet([2, 8, 5]);
var symDifferenceSet = set.symmetricDifference([3, 8, 5]);
symDifferenceSet.toArray();

Related

  • difference(values)

    Returns the set of values that are in this set, excluding the values that are also in the other set.

  • union(values)

    Returns the set of values including all values from both of these sets.

  • intersection(values)

    Returns the set of values that are in both of these sets.