mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
more work
This commit is contained in:
35
node_modules/lodash/array/xor.js
generated
vendored
Normal file
35
node_modules/lodash/array/xor.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
var baseDifference = require('../internal/baseDifference'),
|
||||
baseUniq = require('../internal/baseUniq'),
|
||||
isArguments = require('../lang/isArguments'),
|
||||
isArray = require('../lang/isArray');
|
||||
|
||||
/**
|
||||
* Creates an array 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([1, 2], [4, 2]);
|
||||
* // => [1, 4]
|
||||
*/
|
||||
function xor() {
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
var result = result
|
||||
? baseDifference(result, array).concat(baseDifference(array, result))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result ? baseUniq(result) : [];
|
||||
}
|
||||
|
||||
module.exports = xor;
|
Reference in New Issue
Block a user