This method is like `intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument: (value).
intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)
// => [2.1]
| Name | Type | Attribute | Description |
|---|---|---|---|
| arrays | The arrays to inspect. | ||
| iteratee | The iteratee invoked per element. |
{
"comment": "/**\r\n * This method is like `intersection` except that it accepts `iteratee`\r\n * which is invoked for each element of each `arrays` to generate the criterion\r\n * by which they're compared. The order and references of result values are\r\n * determined by the first array. The iteratee is invoked with one argument:\r\n * (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 intersecting values.\r\n * @example\r\n *\r\n * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r\n * // => [2.1]\r\n */",
"meta": {
"range": [
861,
1191
],
"filename": "intersectionBy.js",
"lineno": 23,
"path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
"code": {
"id": "astnode100003795",
"name": "intersectionBy",
"type": "FunctionDeclaration",
"paramnames": [
"arrays"
]
},
"vars": {
"iteratee": "intersectionBy~iteratee",
"mapped": "intersectionBy~mapped"
}
},
"description": "This method is like `intersection` except that it accepts `iteratee`\rwhich is invoked for each element of each `arrays` to generate the criterion\rby which they're compared. The order and references of result values are\rdetermined by the first array. The iteratee is invoked with one argument:\r(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 intersecting values."
}
],
"examples": [
"intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r// => [2.1]"
],
"name": "intersectionBy",
"longname": "intersectionBy",
"kind": "function",
"scope": "global",
"___id": "T000002R000388",
"___s": true,
"filepath": "intersectionBy.js"
}