> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/array/pullallby.md).

# \_.pullAllBy（删除数组中的元素）

**语法：**

```javascript
_.pullAllBy(array, values, [iteratee=_.identity])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L7749)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.pullallby)

**描述：**

这个方法类似于[`_.pullAll`](https://lodash.com/docs/4.17.10#pullAll)，区别是这个方法接受一个`iteratee`（迭代函数） 调用`array`和

`values`的每个值以产生一个值，通过产生的值进行了比较。iteratee 会传入一个参数：*(value)*。

> **Note:**&#x4E0D;同于[`_.differenceBy`](https://lodash.com/docs/4.17.10#differenceBy), \_.pullAllBy这个方法会改变数组`array`。

**开始版本：**&#x34;.0.0

**参数：**

* `array (Array)`: 要修改的数组。
* `values (Array)`: 要移除值的数组。
* `[iteratee=_.identity] (Array|Function|Object|string)`: iteratee（迭代器）调用每个元素

**返回值：**

* `(Array)`: 返回 array.

**例子：**

```javascript
var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];

_.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
console.log(array);
// => [{ 'x': 2 }]
```
