zipWithIndex method

  1. @useResult
Iterable<(int, T)> zipWithIndex()

Zip with index: (0, e0), (1, e1), ....

Implementation

@useResult
Iterable<(int, T)> zipWithIndex() sync* {
  int i = 0;
  for (final T element in this) {
    yield (i++, element);
  }
}