npm

Does your artifact manager get in the way? Join us on Oct. 8 at 10am PT, to discuss how npm can help.Sign up »

array-xor

0.1.1 • Public • Published

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.

install

npm i array-xor

Downloadsweekly downloads

144

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability