alternate method

void alternate(
  1. T value
)

Separates each element in this list with value.

Implementation

void alternate(T value) {
  for (var i = 1; i < length; i += 2) {
    insert(i, value);
  }
}