Home

Awesome

array-xor NPM version

Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in all given arrays and not in their intersections).

Install

Install with npm

$ npm i array-xor --save

Usage

var xor = require('array-xor');

// given the following arrays
var a = [1, 2, 3, 5, 9];
var b = [3, 4];
var c = [3, 5, 9, 4];

xor(a)
//=> [1, 2, 3, 5, 9]

xor(a, b)
//=> [1, 2, 5, 9, 4]

xor(a, c)
//=> [1, 2, 4]

xor(a, b, c)
//=> [1, 2, 3]

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 26, 2015.