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

# \_.tap

**语法：**

```javascript
_.tap(value, interceptor)
```

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

**描述：**

这个方法调用一个`interceptor`并返回`value`。`interceptor`调用1个参数：*(value)*。 该方法的目的是 进入 方法链序列以便修改中间结果。

**开始版本：**&#x30;.1.0

**参数：**

* `value (*)`: 提供给 interceptor 的值。
* `interceptor (Function)`: 用来调用的函数。

**返回值：**

* `(*)`: 返回 value.

**例子：**

```javascript
_([1, 2, 3])
 .tap(function(array) {
// Mutate input array.
   array.pop();
 })
 .reverse()
 .value();
// => [2, 1]
```
