Powered By GitBook
SYMMETRIC_DIFFERENCE
Returns symmetric difference items in lists

Description

Return a new list with items only found in one of the two given lists, but not in both.

Function signature

1
SYMMETRIC_DIFFERENCE(list1: Array, list2: Array) => Array
Copied!
Parameter
Description
List 1
First list
List 2
Second list

Examples

1
numbers1 = [10,55,66,54,85,91]
2
numbers2 = [52,55,85,10,94]
3
string1 = ["foo","zxc","bar","baz"]
4
string2 = ["foo","bar","baz","abc"]
5
array1 = [{"name":"Kate","age":30},{"name":"Jack","age":30},{"name":"Kate","age":25}]
6
array2 = [{"name":"Jack","age":30},{"name":"Jon","age":32},{"name":"Kate","age":30}]
Copied!
Formula
Return value
SYMMETRIC_DIFFERENCE(numbers1, numbers2)
[66,54,91,52,94]
SYMMETRIC_DIFFERENCE(string1, string2)
["zxc","abc"]
SYMMETRIC_DIFFERENCE(array1, array2)
[{"name":"Kate","age":25},{"name":"Jon","age":32}]
Last modified 10mo ago
Export as PDF
Copy link