artdaq_node_server  v1_00_08
 All Classes Namespaces Files Variables Pages
remove.js
1 var baseIteratee = require('./_baseIteratee'),
2  basePullAt = require('./_basePullAt');
3 
32 function remove(array, predicate) {
33  var result = [];
34  if (!(array && array.length)) {
35  return result;
36  }
37  var index = -1,
38  indexes = [],
39  length = array.length;
40 
41  predicate = baseIteratee(predicate, 3);
42  while (++index < length) {
43  var value = array[index];
44  if (predicate(value, index, array)) {
45  result.push(value);
46  indexes.push(index);
47  }
48  }
49  basePullAt(array, indexes);
50  return result;
51 }
52 
53 module.exports = remove;