1 var castPath = require('./_castPath'),
2 isIndex = require('./_isIndex'),
3 isKey = require('./_isKey'),
4 last = require('./last'),
5 parent = require('./_parent'),
6 toKey = require('./_toKey');
8 /** Used for built-in method references. */
9 var arrayProto = Array.prototype;
11 /** Built-in value references. */
12 var splice = arrayProto.splice;
15 * The base implementation of `_.pullAt` without support for individual
16 * indexes or capturing the removed elements.
19 * @param {Array} array The array to modify.
20 * @param {number[]} indexes The indexes of elements to remove.
21 * @returns {Array} Returns `array`.
23 function basePullAt(array, indexes) {
24 var length = array ? indexes.length : 0,
25 lastIndex = length - 1;
28 var index = indexes[length];
29 if (length == lastIndex || index !== previous) {
32 splice.call(array, index, 1);
34 else if (!isKey(index, array)) {
35 var path = castPath(index),
36 object = parent(array, path);
39 delete object[toKey(last(path))];
43 delete array[toKey(index)];
50 module.exports = basePullAt;