Files
lodash/xor.js
John-David Dalton 18d0f1d873 Bump to v4.7.0.
2016-03-31 08:47:39 -07:00

28 lines
757 B
JavaScript

var arrayFilter = require('./_arrayFilter'),
baseXor = require('./_baseXor'),
isArrayLikeObject = require('./isArrayLikeObject'),
rest = require('./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.
* @example
*
* _.xor([2, 1], [4, 2]);
* // => [1, 4]
*/
var xor = rest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
module.exports = xor;