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

# \_.defer

**语法：**

```javascript
_.defer(func, [args])
```

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

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

**描述：**

推迟调用`func`，直到当前堆栈清理完毕。 调用时，任何附加的参数会传给`func`。

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

**参数：**

* `func (Function)`: 要延迟的函数。
* `[args] (...*)`: 会在调用时传给 func 的参数。

**返回值：**

* `(number)`:返回计时器 id。

**例子：**

```javascript
_.defer(function(text) {
  console.log(text);
}, 'deferred');
// => 一毫秒或更久一些输出 'deferred'。
```
