mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
655 B
25 lines
655 B
9 years ago
|
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.
|
||
|
*
|
||
|
* @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));
|
||
|
});
|
||
|
|
||
|
module.exports = xor;
|