00001 var baseUnset = require('./_baseUnset'), 00002 isIndex = require('./_isIndex'); 00003 00005 var arrayProto = Array.prototype; 00006 00008 var splice = arrayProto.splice; 00009 00019 function basePullAt(array, indexes) { 00020 var length = array ? indexes.length : 0, 00021 lastIndex = length - 1; 00022 00023 while (length--) { 00024 var index = indexes[length]; 00025 if (length == lastIndex || index !== previous) { 00026 var previous = index; 00027 if (isIndex(index)) { 00028 splice.call(array, index, 1); 00029 } else { 00030 baseUnset(array, index); 00031 } 00032 } 00033 } 00034 return array; 00035 } 00036 00037 module.exports = basePullAt;