Example 1 — Official: Array of Indexes
Remove two slots and keep both the survivors and the pulled values.
var array = ['a', 'b', 'c', 'd'];
var pulled = _.pullAt(array, [1, 3]);
console.log(array);
// → ['a', 'c']
console.log(pulled);
// → ['b', 'd'] How It Works
- Indexes. Ask for positions
1and3. - Collect. Those slots hold
'b'and'd'. - Mutate. Source shrinks to
['a', 'c']. - Return.
pulledis a new array — not the same asarray.

