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

# \_.ary

**语法：**

```javascript
_.ary(func, [n=func.length])
```

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

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

**描述：**

创建一个调用`func`的函数。调用`func`时最多接受`n`个参数，忽略多出的参数。

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

**参数：**

* `func (Function)`: 需要被限制参数个数的函数。
* `[n=func.length] (number)`: 限制的参数数量。

**返回值：**

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

**例子：**

```javascript
_.map(['6', '8', '10'], _.ary(parseInt, 1));
// => [6, 8, 10]
```
