4.17.11
3.10.1
2.4.2
1.3.1

_.pullAt(array, [indexes])

Removes elements from array corresponding to indexes and returns an array of removed elements.

Note: Unlike _.at, this method mutates array.

Since

3.0.0

Arguments

argument
array
[indexes]
type
Array
...(number|number[])
description
The array to modify.
The indexes of elements to remove.

Returns

(array)

Example

var array = ["a", "b", "c", "d"];
var pulled = _.pullAt(array, [1, 3]);

console.log(array);
// => ['a', 'c']

console.log(pulled);
// => ['b', 'd']
var array = ["a", "b", "c", "d"];
var pulled = _.pullAt(array, [1, 3]);

console.log(array);
// => ['a', 'c']

console.log(pulled);
// => ['b', 'd']