transform method

void transform(
  1. int index,
  2. ListTransformer<T> transformer
)

Updates the element at index to the value returned by transformer.

Implementation

void transform(int index, ListTransformer<T> transformer) {
  assert(index >= 0 && index < length);
  this[index] = transformer(this[index]);
}