source: node_modules/ramda/es/symmetricDifference.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 910 bytes
RevLine 
[d24f17c]1import _curry2 from "./internal/_curry2.js";
2import concat from "./concat.js";
3import 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
23var symmetricDifference =
24/*#__PURE__*/
25_curry2(function symmetricDifference(list1, list2) {
26 return concat(difference(list1, list2), difference(list2, list1));
27});
28
29export default symmetricDifference;
Note: See TracBrowser for help on using the repository browser.