The array to modify.
Rest
...indexes: (string | number)[]The indexes of elements to remove.
Rest
Returns the new array of removed elements.
5.11.0
[[pull]], [[pullAll]], [[pullAllBy]], [[pullAllWith]], [[remove]], [[reject]]
const array = ['a', 'b', 'c', 'd']
const pulled = pullAt(array, [1, 3])
console.log(array)
// => ['a', 'c']
console.log(pulled)
// => ['b', 'd']
Removes elements from
array
corresponding toindexes
and returns an array of removed elements.Note: Unlike
at
, this method mutatesarray
.