array-complement

Returns an array of unique values that is the symmetric difference of the provided arrays.

Usage no npm install needed!

<script type="module">
  import arrayComplement from 'https://cdn.skypack.dev/array-complement';
</script>

README

array-complement

Returns an array of unique values that is the symmetric difference of the provided arrays.

Install

npm install array-complement
bower install array-complement

Usage

const arrayComplement = require('array-complement');

console.log(arrayComplement(['foo','bar'], ['bar'])); // ['foo']
console.log(arrayComplement(['foo','bar','qux'],['qux','baz'],['thud','norf','bar'])); // ['foo','baz','thud','norf']

Test

npm test

License

MIT