mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
wip: migrate to bun
This commit is contained in:
24
src/xor.ts
Normal file
24
src/xor.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import baseXor from './.internal/baseXor.js';
|
||||
import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @since 2.4.0
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see difference, union, unionBy, unionWith, without, xorBy, xorWith
|
||||
* @example
|
||||
*
|
||||
* xor([2, 1], [2, 3])
|
||||
* // => [1, 3]
|
||||
*/
|
||||
function xor(...arrays) {
|
||||
return baseXor(arrays.filter(isArrayLikeObject));
|
||||
}
|
||||
|
||||
export default xor;
|
||||
Reference in New Issue
Block a user