forEach2<Y> method
normal forEach with the current index given to you in the transformer
forEach2 is the same as forEach but with the index given to you in the transformer
Implementation
void forEach2<Y>(final void Function(T value, int index) transformer) {
int index = 0;
forEach((final T item) {
transformer(item, index);
index = index + 1;
});
}