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