whereIndexed method
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;
}
}