removeAt(index) {
    if (index < 0 || index >= this.getLength()) {
      return undefined;
    }
    const prev = this.array_[index];
    this.array_.splice(index, 1);
    this.updateLength_();
    this.dispatchEvent(
      /** @type {CollectionEvent<T>} */ (
        new CollectionEvent(CollectionEventType.REMOVE, prev, index)
      ),
    );
    return prev;
  }
Remove the element at the provided index and return it.
Return `undefined` if the collection does not contain this index.
@param {number} index Index.
@return {T|undefined} Value.
@api