Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / basePullAt.js
1 var isIndex = require('./isIndex');
2
3 /** Used for native method references. */
4 var arrayProto = Array.prototype;
5
6 /** Native method references. */
7 var splice = arrayProto.splice;
8
9 /**
10  * The base implementation of `_.pullAt` without support for individual
11  * index arguments and capturing the removed elements.
12  *
13  * @private
14  * @param {Array} array The array to modify.
15  * @param {number[]} indexes The indexes of elements to remove.
16  * @returns {Array} Returns `array`.
17  */
18 function basePullAt(array, indexes) {
19   var length = array ? indexes.length : 0;
20   while (length--) {
21     var index = indexes[length];
22     if (index != previous && isIndex(index)) {
23       var previous = index;
24       splice.call(array, index, 1);
25     }
26   }
27   return array;
28 }
29
30 module.exports = basePullAt;