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

# \_.rearg

**语法：**

```javascript
_.rearg(func, indexes)
```

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

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

**描述：**

创建一个函数,调用`func`时，根据指定的`indexes`调整对应位置参数。其中第一个索引值是对应第一个参数，第二个索引值是作为第二个参数，依此类推。

**开始版本：**&#x33;.0.0

**参数：**

* `func (Function)`: 待调用的函数。
* `indexes (...(number|number[]))`: 排列参数的位置。

**返回值：**

* `(Function)`: 返回新的函数。

**例子：**

```javascript
var rearged = _.rearg(function(a, b, c) {
  return [a, b, c];
}, [2, 0, 1]);

rearged('b', 'c', 'a')
// => ['a', 'b', 'c']
```
