企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## ary + [link](./ary "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L8353 "View in source.") + [npm](https://www.npmjs.com/package/lodash.ary "See the npm package.") ``` _.ary(func, [n=func.length]) ``` 创建一个最多接受 `N` 个参数,忽略多余参数的方法。 ### 参数 1. func (Function) 需要被限制参数个数的函数 2. [n=func.length] (number) 限制的参数数量 ### 返回值 (Function) 返回新的函数 ### 示例 ``` _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10] ```