Files
lodash/xor.js
John-David Dalton 8bff780a94 Bump to v4.3.0.
2016-02-08 00:50:21 -08:00

25 lines
641 B
JavaScript

import arrayFilter from './_arrayFilter';
import baseXor from './_baseXor';
import isArrayLikeObject from './isArrayLikeObject';
import rest from './rest';
/**
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays.
*
* @static
* @memberOf _
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of values.
* @example
*
* _.xor([2, 1], [4, 2]);
* // => [1, 4]
*/
var xor = rest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
export default xor;