difference(_ values: [Element]) -> [Element]

Creates an array of unique array values not included in the other provided arrays.

Parameters

  • values: The values to exclude.

Returns

The new array of filtered values.

[1,2,3,4,5].difference([1,2,3])
// -> [4,5]