replace method

void replace(
  1. int index,
  2. T newValue
)

Implementation

void replace(int index, T newValue) {
  if (index < 0 || index > lastIndex) {
    return;
  }

  this[index] = newValue;
}