forEachWhile method
- bool action(
- E element
Takes an action for each element as long as desired.
Calls action
for each element.
Stops iteration if action
returns false
.
Implementation
void forEachWhile(bool Function(E element) action) {
for (var index = 0; index < length; index++) {
if (!action(this[index])) break;
}
}