Powered By GitBook
DIFFERENCE
Returns difference items in lists

Description

Returns a list with all the values from the first list that are not present in the second list. In other words, excludes all values from the first list that are given as a second list.

Function signature

1
DIFFERENCE(sourcelist: Array, itemstoexclude: Array) => Array
Copied!
Parameter
Description
Source list
The first list containing possibly returned items
Items to exclude
List of items to exclude from the first list

Examples

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