Files
lodash/xor.js
John-David Dalton 35805ec250 Bump to v4.11.2.
2016-04-21 07:06:47 -07:00

29 lines
775 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. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [4, 2]);
* // => [1, 4]
*/
var xor = rest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
export default xor;