AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## 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'] ```