1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-06 22:27:21 -05:00
notes/node_modules/lodash/xor.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

29 lines
811 B
JavaScript

var arrayFilter = require('./_arrayFilter'),
baseRest = require('./_baseRest'),
baseXor = require('./_baseXor'),
isArrayLikeObject = require('./isArrayLikeObject');
/**
* 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 filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
module.exports = xor;