code: function removeFromArray(array, value, opt_notype) {
      var shift = 0;
      for (var i = 0; i < array.length; ++i) {
          if (array[i] === value || (opt_notype && array[i] === value)) {
              array.splice(i--, 1);
              shift++;
          }
      }
      return shift;
  }
docs: Removes value from array. Returns the number of instances of value
  that were removed from array.