ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## pullAt + [link](./pullAt "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6334 "View in source.") + [npm](https://www.npmjs.com/package/lodash.pullat "See the npm package.") ``` _.pullAt(array, [indexes]) ``` 根据给的 `indexes` 移除对应的数组元素并返回被移除的元素。 **注意:** 不同于 `_.at`,这个方法会改变数组。 ### 参数 1. array (Array) 需要调整的数组 2. [indexes] (...(number|number[]) indexes 可以是特殊的数组队列,或者个别的单个或多个参数 ### 返回值 (Array) 返回被移除的元素数组 ### 示例 ``` var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3); console.log(array); // => [5, 15] console.log(evens); // => [10, 20] ```