mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Bump to v4.0.0.
This commit is contained in:
24
xor.js
Normal file
24
xor.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var arrayFilter = require('./internal/arrayFilter'),
|
||||
baseXor = require('./internal/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 provided 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;
|
||||
Reference in New Issue
Block a user