多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## intersectionBy + [link](./intersectionBy "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6114 "View in source.") + [npm](https://www.npmjs.com/package/lodash.intersectionby "See the npm package.") ``` _.intersectionBy([arrays], [iteratee=_.identity]) ``` 这个方法类似 `_.intersection`,除了它接受一个 iteratee 调用每一个数组和值。iteratee 会传入一个参数:(value) ### 参数 1. [arrays] (...Array) 需要检索的数组 2. [iteratee=_.identity] (Function|Object|string) 这个函数会处理每一个元素 ### 返回值 (Array) 返回数组中共享元素的新数组 ### 示例 ``` _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); // => [2.1] // 使用了 `_.property` 的回调结果 _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }] ```