pullAt
Array
since 3.0.0
Arguments
- Array The array to modify.
- ...(number|number[]) The indexes of elements to remove.
Returns
Array the new array of removed elements.
Removes elements from array
corresponding to indexes
and returns an
array of removed elements.
Note: Unlike _.at
, this method mutates array
.
Example of Lodash _.pullAt
var array = ['a', 'b', 'c', 'd'];
var pulled = _.pullAt(array, [1, 3]);
console.log(array);
// => ['a', 'c']
console.log(pulled);
// => ['b', 'd']