🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## rearg + [link](./rearg "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L9037 "View in source.") + [npm](https://www.npmjs.com/package/lodash.rearg "See the npm package.") ``` _.rearg(func, indexes) ``` 创建一个调用 `func` 的函数。 所传递的参数根据 indexes 调整到对应位置。 第一个 index 对应到第一个传参,第二个 index 对应到第二个传参,以此类推。 ### 参数 1. func (Function) 待调用的函数 2. indexes (...(number|number[]) 重新排列参数的位置,单独指定或者指定在数组中 ### 返回值 (Function) 返回新的函数 ### 示例 ``` var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1); rearged('b', 'c', 'a') // => ['a', 'b', 'c'] ```