Array XOR
Generic array xor function which supports equals predicate function.
Install
npm install arr-xor
Usage
var xor = ; ;//=> [1, 3] ;//=> [1, 4] ;//=> [{id: 1}, {id: 3}]
API
xor(...arrays, [equalsPredicate])
Creates an array of unique values that is the symmetric difference of the provided arrays.
...arrays
Required
Type: array
Two or more arrays to do XOR operation.
equalsPredicate
Type: function
Default: function(a, b) { return a === b; }
Equality function. Should return true if a
and b
items are equal.
License
MIT