This method is like `xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The order of result values is determined by the order they occur in the arrays. The comparator is invoked with two arguments: (arrVal, othVal).
const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]
xorWith(objects, others, isEqual)
// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
Name | Type | Attribute | Description |
---|---|---|---|
arrays | The arrays to inspect. | ||
comparator | The comparator invoked per element. |
{ "comment": "/**\r\n * This method is like `xor` except that it accepts `comparator` which is\r\n * invoked to compare elements of `arrays`. The order of result values is\r\n * determined by the order they occur in the arrays. The comparator is invoked\r\n * with two arguments: (arrVal, othVal).\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {...Array} [arrays] The arrays to inspect.\r\n * @param {Function} [comparator] The comparator invoked per element.\r\n * @returns {Array} Returns the new array of filtered values.\r\n * @see difference, union, unionBy, unionWith, without, xor, xorBy\r\n * @example\r\n *\r\n * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\r\n * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\r\n *\r\n * xorWith(objects, others, isEqual)\r\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\r\n */", "meta": { "range": [ 998, 1217 ], "filename": "xorWith.js", "lineno": 26, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100011805", "name": "xorWith", "type": "FunctionDeclaration", "paramnames": [ "arrays" ] }, "vars": { "comparator": "xorWith~comparator" } }, "description": "This method is like `xor` except that it accepts `comparator` which is\rinvoked to compare elements of `arrays`. The order of result values is\rdetermined by the order they occur in the arrays. The comparator is invoked\rwith two arguments: (arrVal, othVal).", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Array", "value": "Array" } ], "params": [ { "type": { "names": [ "Array" ] }, "optional": true, "variable": true, "description": "The arrays to inspect.", "name": "arrays" }, { "type": { "names": [ "function" ] }, "optional": true, "description": "The comparator invoked per element.", "name": "comparator" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns the new array of filtered values." } ], "see": [ "difference, union, unionBy, unionWith, without, xor, xorBy" ], "examples": [ "const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\rconst others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]\r\rxorWith(objects, others, isEqual)\r// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]" ], "name": "xorWith", "longname": "xorWith", "kind": "function", "scope": "global", "___id": "T000002R001066", "___s": true, "filepath": "xorWith.js" }