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