xor-with

v4.17.15arrow_drop_down
v4.17.15
v4.17.11
STATUS
Passing
DOWNLOADS
134
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`.
2 contributors
Install xor-with as a package?
Copied
npm i @bit/lodash.lodash.xor-with
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
xorWith (
arrays:...Array?,
comparator:Function?
) : Array

This method is like xor except that it accepts comparator which is invoked to compare elements of arrays. The order of result values is determined by the order they occur in the arrays. The comparator is invoked with two arguments: (arrVal, othVal).

Example
const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]

xorWith(objects, others, isEqual)
// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
Arguments
arrays: ...Array?

The arrays to inspect.

comparator: Function?

The comparator invoked per element.

Returns
Array

Returns the new array of filtered values.

Help and resources