code: function(entities, options) {
        var removed = [];
        for (var i = 0; i < entities.length; i++) {
          var entity = this.get(entities[i]);
          if (!entity) continue;
  
          var index = this.indexOf(entity);
          this.entities.splice(index, 1);
          this.length--;
  
          // Remove references before triggering 'remove' event to prevent an
          // infinite loop. #3693
          delete this._byId[entity.cid];
          var id = this.entityId(entity.attributes);
          if (id != null) delete this._byId[id];
  
          if (!options.silent) {
            options.index = index;
            entity.trigger('remove', entity, this, options);
          }
  
          removed.push(entity);
          this._removeReference(entity, options);
        }
        return removed;
      }
docs: Internal method called by both remove and set.