多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## defer + [link](./defer "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L8751 "View in source.") + [npm](https://www.npmjs.com/package/lodash.defer "See the npm package.") ``` _.defer(func, [args]) ``` 延迟调用 `func` 直到当前堆栈清理完毕。 任何附加的参数会传入到 `func`。 ### 参数 1. func (Function) 要延迟的函数 2. [args] (...*) 会在调用时传入到 `func` 的参数 ### 返回值 (number) 返回计时器 id ### 示例 ``` _.defer(function(text) { console.log(text); }, 'deferred'); // 一毫秒或更久一些输出 'deferred'。 ```