# arr-xor

> Generic array xor. Supports predicate equals function.

Latest version **1.0.1** (published 2015-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install arr-xor
pnpm add arr-xor
yarn add arr-xor
bun add arr-xor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-09-21 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kimmo Brunfeldt |
| Maintainers | kimmobrunfeldt |
| Keywords | array, xor, predicate |

## Links

- npm: https://www.npmjs.com/package/arr-xor
- Repository: https://github.com/kimmobrunfeldt/arr-xor
- Homepage: https://github.com/kimmobrunfeldt/arr-xor#readme
- Issues: https://github.com/kimmobrunfeldt/arr-xor/issues
- npm.io page: https://npm.io/package/arr-xor

## Dependencies (6)

- [lodash.map](https://npm.io/package/lodash.map.md) ^3.1.4
- [lodash.sum](https://npm.io/package/lodash.sum.md) ^3.6.2
- [lodash.last](https://npm.io/package/lodash.last.md) ^3.0.0
- [lodash.reduce](https://npm.io/package/lodash.reduce.md) ^3.1.2
- [lodash.findindex](https://npm.io/package/lodash.findindex.md) ^3.2.1
- [lodash.isfunction](https://npm.io/package/lodash.isfunction.md) ^3.0.6

## Recent versions

- 1.0.1 (latest) — 2015-09-21
- 1.0.0 — 2015-09-21

## README

# Array XOR

[![Build Status](https://travis-ci.org/kimmobrunfeldt/arr-xor.svg?branch=master)](https://travis-ci.org/kimmobrunfeldt/arr-xor)

Generic array xor function which supports equals predicate function.

## Install

```
npm install arr-xor
```

## Usage

```js
var xor = require('arr-xor');

xor([1, 2], [2, 3]);
//=> [1, 3]

xor([1, 2], [2, 3], [3, 4]);
//=> [1, 4]

xor([{id: 1}, {id: 2}], [{id: 2}, {id: 3}], function equals(a, b) {
    return a.id === b.id;
});
//=> [{id: 1}, {id: 3}]
```

## API

### xor(...arrays, [equalsPredicate])

Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/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

---
_Source: https://npm.io/package/arr-xor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
