Skip to main content

Xor Sets

Find the symmetric difference between two sets

Written by Holly Conrad Smith

Use this to find everything that's different between two groups — items in either one but not both — for example, spotting every usage that was added or removed between two versions of a project.

Set vs. List: a List (array) keeps items in order and can hold duplicates — you access items by position, like "the 3rd item." A Set has no order and no duplicates — adding an item that's already there does nothing, and there's no "position" to ask for. Sets are for asking "is this here?" and for comparing groups of things; Lists are for ordered, step-by-step sequences.

This is different from Difference Sets: Difference Sets is one-directional (what's in set1 but not set2), while Xor Sets is two-directional (what's unique to either set, ignoring anything they share).

Category: Sets

Kind: Operation

Description: find the symmetric difference between two sets

Inputs

Name

Abbreviation

Type

Access

Description

set1

S1

Set

Item

the first set

set2

S2

Set

Item

the second set

Outputs

Name

Abbreviation

Type

Access

Description

symmetricDifference

SD

Set

Item

the symmetric difference of the two sets

How to

  1. Add the Xor Sets node.

  2. Feed in two sets.

  3. The output is a new set containing everything that's in exactly one of the two sets, but not both.

Did this answer your question?