ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
## spread + [link](./spread "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L9125 "View in source.") + [npm](https://www.npmjs.com/package/lodash.spread "See the npm package.") ``` _.spread(func) ``` 创建一个调用 `func` 的函数。 `this` 绑定到这个函数上。 把参数作为数组传入,类似于 [`Function#apply`](https://es5.github.io/#x15.3.4.3) **注意:** 这个方法基于 [spread operator](https://mdn.io/spread_operator) ### 参数 1. func (Function) 要应用的函数 ### 返回值 (Function) 返回新的函数 ### 示例 ``` var say = _.spread(function(who, what) { return who + ' says ' + what; }); say(['fred', 'hello']); // => 'fred says hello' var numbers = Promise.all([ Promise.resolve(40), Promise.resolve(36) ]); numbers.then(_.spread(function(x, y) { return x + y; })); // => 返回 76 ```