code: function filterInPlace (arr, pred) {
    var idx = 0;
    for (var ii = 0; ii < arr.length; ++ii) {
      if (pred(arr[ii])) {
        arr[idx] = arr[ii];
        ++idx;
      }
    }
    arr.length = idx;
  }
docs: keeps if pred is true