Open this example in the interactive library
Source code
console.log([
...new Set(["red", "blue"]).symmetricDifference(
new Set(["blue", "green"]),
),
]);
Sample output
[ 'red', 'green' ]

Open this example in the interactive library
console.log([
...new Set(["red", "blue"]).symmetricDifference(
new Set(["blue", "green"]),
),
]);
[ 'red', 'green' ]