mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Cleanup _.xor.
This commit is contained in:
11
dist/lodash.compat.js
vendored
11
dist/lodash.compat.js
vendored
@@ -5365,17 +5365,18 @@
|
||||
* // => [1, 4, 5]
|
||||
*/
|
||||
function xor() {
|
||||
var index = 0,
|
||||
length = arguments.length,
|
||||
result = arguments[0] || [];
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
result = baseUniq(baseDifference(result, array).concat(baseDifference(array, result)));
|
||||
var result = result
|
||||
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return result || [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user