Home

function: xorBy


xorBy(arrays: Array, iteratee: function): Array

This method is like `xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which by which they're compared. The order of result values is determined by the order they occur in the arrays. The iteratee is invoked with one argument: (value).

Example(s):

xorBy([2.1, 1.2], [2.3, 3.4], Math.floor)
// => [1.2, 3.4]

Params:

Name Type Attribute Description
arrays The arrays to inspect.
iteratee The iteratee invoked per element.

Returns:

Array

  {
    "comment": "/**\r\n * This method is like `xor` except that it accepts `iteratee` which is\r\n * invoked for each element of each `arrays` to generate the criterion by\r\n * which by which they're compared. The order of result values is determined\r\n * by the order they occur in the arrays. The iteratee is invoked with one\r\n * argument: (value).\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} iteratee The iteratee invoked per element.\r\n * @returns {Array} Returns the new array of filtered values.\r\n * @see difference, union, unionBy, unionWith, without, xor, xorWith\r\n * @example\r\n *\r\n * xorBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r\n * // => [1.2, 3.4]\r\n */",
    "meta": {
        "range": [
            900,
            1098
        ],
        "filename": "xorBy.js",
        "lineno": 24,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011758",
            "name": "xorBy",
            "type": "FunctionDeclaration",
            "paramnames": [
                "arrays"
            ]
        },
        "vars": {
            "iteratee": "xorBy~iteratee"
        }
    },
    "description": "This method is like `xor` except that it accepts `iteratee` which is\rinvoked for each element of each `arrays` to generate the criterion by\rwhich by which they're compared. The order of result values is determined\rby the order they occur in the arrays. The iteratee is invoked with one\rargument: (value).",
    "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"
                ]
            },
            "description": "The iteratee invoked per element.",
            "name": "iteratee"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new array of filtered values."
        }
    ],
    "see": [
        "difference, union, unionBy, unionWith, without, xor, xorWith"
    ],
    "examples": [
        "xorBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r// => [1.2, 3.4]"
    ],
    "name": "xorBy",
    "longname": "xorBy",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001062",
    "___s": true,
    "filepath": "xorBy.js"
}