UNPKG

556 BJavaScriptView Raw
1import isArrayLike from './is-array-like';
2var splice = Array.prototype.splice;
3var pullAt = function pullAt(arr, indexes) {
4 if (!isArrayLike(arr)) {
5 return [];
6 }
7 var length = arr ? indexes.length : 0;
8 var last = length - 1;
9 while (length--) {
10 var previous = void 0;
11 var index = indexes[length];
12 if (length === last || index !== previous) {
13 previous = index;
14 splice.call(arr, index, 1);
15 }
16 }
17 return arr;
18};
19export default pullAt;
20//# sourceMappingURL=pull-at.js.map
\No newline at end of file