whereIndexed method

Iterable<T> whereIndexed(
  1. bool test(
    1. int index,
    2. T element
    )
)

The elements whose value and index satisfies test.

Implementation

Iterable<T> whereIndexed(bool Function(int index, T element) test) sync* {
  var index = 0;
  for (var element in this) {
    if (test(index++, element)) yield element;
  }
}