> 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/pull.md).

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

**语法：**

```javascript
_.pull(array, [values])
```

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

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

**描述：**

移除数组`array`中所有和给定值相等的元素，使用[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)进行全等比较。

> **注意：**&#x548C;[`_.without`](https://lodash.com/docs/4.17.10#without)方法不同，\_.pull这个方法会改变数组。使用[`_.remove`](https://lodash.com/docs/4.17.10#remove)从一个数组中移除元素。

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

**参数：**

* `array (Array)`: 要修改的数组。
* `[values] (...*)`: 要删除的值。

**返回值：**

* `(Array)`: 返回 array。

**例子：**

```javascript
var array = ['a', 'b', 'c', 'a', 'b', 'c'];

_.pull(array, 'a', 'c');
console.log(array);
// => ['b', 'b']
```
