1 | import _curry2 from "./internal/_curry2.js";
|
---|
2 | import concat from "./concat.js";
|
---|
3 | import difference from "./difference.js";
|
---|
4 | /**
|
---|
5 | * Finds the set (i.e. no duplicates) of all elements contained in the first or
|
---|
6 | * second list, but not both.
|
---|
7 | *
|
---|
8 | * @func
|
---|
9 | * @memberOf R
|
---|
10 | * @since v0.19.0
|
---|
11 | * @category Relation
|
---|
12 | * @sig [*] -> [*] -> [*]
|
---|
13 | * @param {Array} list1 The first list.
|
---|
14 | * @param {Array} list2 The second list.
|
---|
15 | * @return {Array} The elements in `list1` or `list2`, but not both.
|
---|
16 | * @see R.symmetricDifferenceWith, R.difference, R.differenceWith
|
---|
17 | * @example
|
---|
18 | *
|
---|
19 | * R.symmetricDifference([1,2,3,4], [7,6,5,4,3]); //=> [1,2,7,6,5]
|
---|
20 | * R.symmetricDifference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5,1,2]
|
---|
21 | */
|
---|
22 |
|
---|
23 | var symmetricDifference =
|
---|
24 | /*#__PURE__*/
|
---|
25 | _curry2(function symmetricDifference(list1, list2) {
|
---|
26 | return concat(difference(list1, list2), difference(list2, list1));
|
---|
27 | });
|
---|
28 |
|
---|
29 | export default symmetricDifference; |
---|